You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code type-checks properly, but an assertion fails during SSA generation.
The reassignment is invalid since the two lambdas have different environment types, and should be caught during type-checking.
fn main() {
let a: u32 = 1;
let b: u32 = 1;
let mut f = || a;
f = || a + b;
f();
}
Expected Behavior
We may want to support this behavior long term, but it's difficult since the lambdas are of different types, so for the time being I think we should throw a type error that the assignment is invalid.
Bug
The compiler crashes on the code above
To Reproduce
Compile the code above
Installation Method
Compiled from source
Nargo Version
nargo 0.9.0
Additional Context
No response
Would you like to submit a PR for this Issue?
Yes
Support Needs
No response
The text was updated successfully, but these errors were encountered:
We may want to support this behavior long term, but it's difficult since the lambdas are of different types, so for the time being I think we should throw a type error that the assignment is invalid.
I agree with this assessment, lets issue a type error now and we can look into allowing this later
Aim
This code type-checks properly, but an assertion fails during SSA generation.
The reassignment is invalid since the two lambdas have different environment types, and should be caught during type-checking.
Expected Behavior
We may want to support this behavior long term, but it's difficult since the lambdas are of different types, so for the time being I think we should throw a type error that the assignment is invalid.
Bug
The compiler crashes on the code above
To Reproduce
Compile the code above
Installation Method
Compiled from source
Nargo Version
nargo 0.9.0
Additional Context
No response
Would you like to submit a PR for this Issue?
Yes
Support Needs
No response
The text was updated successfully, but these errors were encountered: