mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
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:
parent
bd2dd66c96
commit
54cc5e4c29
4 changed files with 102 additions and 223 deletions
|
@ -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! ->
|
||||
^^^
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue