Fix unifying pure with flex vars

This commit is contained in:
Agus Zubiaga 2024-10-22 00:07:45 -03:00
parent 6533e9084d
commit 89a918cebe
No known key found for this signature in database
12 changed files with 230 additions and 154 deletions

View file

@ -204,7 +204,7 @@ pub fn can_expr_with<'a>(
rigids: MutMap::default(),
home,
resolutions_to_make: vec![],
enclosing_fx: None,
fx_expectation: None,
},
loc_expr.region,
&loc_expr.value,

View file

@ -5419,9 +5419,9 @@ mod test_reporting {
6 2 -> 2
^^
Looks like you are trying to define a function.
Looks like you are trying to define a function.
In Roc, functions are always written as a lambda, like
In Roc, functions are always written as a lambda, like
increment = \n -> n + 1
"#
@ -14762,6 +14762,16 @@ All branches in an `if` must have the same type!
You can still run the program with this error, which can be helpful
when you're debugging.
UNNECESSARY EXCLAMATION in /code/proj/Main.roc
This function is pure, but its name suggests otherwise:
5 main! = \{} ->
^^^^^
Remove the exclamation mark to give an accurate impression of its
behavior.
"###
);