Redo fix of closure param type inference, drop typeScheme/2

The solution for inferring the type of a closure parameter using
auxiliary typeScheme/2 constraint and processing all "inference sites"
doesn't work for some situations, such as closure returning a closure with
untyped (var) parameter.

The new solution uses regular typeOf/2 constraint and calculates the
closure type assuming a variable as the return type. This must not be inferred from the context.

Avoid assigning a type to the closure the 2nd time, which
causes a cascade of typeOf/2 activations.
This commit is contained in:
Fedor Isakov 2022-11-21 16:05:02 +01:00
parent e5c56fbb40
commit 25b82ebfb1
2 changed files with 421 additions and 4687 deletions