Unify let-introduction in a single path

Remove branches on determining how let-bindings are introduced to the
scope. This is maybe a little more inefficient, but I think it is a huge
simplification.

One additional change this required was changing how fx suffixes are
checked. The current implementation would add additional constraints for
patterns in let bindings conditionally. However, this is unnecessary. I
believe it is sufficient to check the fx suffix by running the checks on
all introduced symbols after the type is well known (i.e. the body is
checked).
This commit is contained in:
Ayaz Hafiz 2025-01-01 21:46:11 -06:00
parent bd2dd66c96
commit 54cc5e4c29
No known key found for this signature in database
GPG key ID: 4EBD1C71C734E4D4
4 changed files with 102 additions and 223 deletions

View file

@ -15666,7 +15666,7 @@ All branches in an `if` must have the same type!
@r###"
MISSING EXCLAMATION in /code/proj/Main.roc
This is an effectful function, but its name does not indicate so:
This function is effectful, but its name does not indicate so:
10 forEach! = \l, f ->
^
@ -15703,7 +15703,7 @@ All branches in an `if` must have the same type!
@r###"
UNNECESSARY EXCLAMATION in /code/proj/Main.roc
This is a pure function, but its name suggests otherwise:
This function is pure, but its name suggests otherwise:
12 mapOk = \result, fn! ->
^^^