Files
n8n-openai-adapter/lib/elixir
José Valim 860f485bdf Inference of patterns (#13909)
This pull request adds inference of patterns, being able to
refine types as new information is added. The next step is
to use this inference in the compiler itself.

Future work will add module-local inference of return types
(most likely still in v1.18) and inference of guards (most
likely in v1.19).

In order to support inference of patterns, Elixir will raise
if it finds recursive variable definitions. This means
patterns that never match, such as this one, will no longer
compile:

    def foo(x = {:ok, y}, x = y)

However, recursion of root variables (where variables directly
point to each other), will also fail to compile:

    def foo(x = y, y = z, z = x)

While the definition above could succeed (as long as all three
arguments are equal), there is a much cleaner version of writing
the same code, that does not require solving cycles in our head:

    def foo(x, x, x)
2024-10-18 11:01:23 +02:00
..
2024-10-18 11:01:23 +02:00
2024-09-17 18:01:25 +02:00
2024-10-18 11:01:23 +02:00
2024-10-18 11:01:23 +02:00
2024-07-02 15:21:25 +02:00
2017-10-08 19:34:44 +02:00