Test emitting let instead of var.
Fixes https://github.com/rescript-lang/rescript-compiler/issues/856
-
Need to check that no cases are missed where this could introduce regressions even if the tests appear to be passing
-
This will generate a huge amount of noise in the diff w.r.t. other versions of the compiler. It might not be ideal to have this change in an initial version of compiler v11 if other changes are important as they would get lost in the noise
-
Note that the transformation creating problems in https://github.com/rescript-lang/rescript-compiler/pull/6479 can be removed
You can then remove the previous fix (using IIFE) used to capture mutable variable
I wonder how much it'll affect performance. But probably it won't be a big difference.
@DZakh did you see this: https://github.com/rescript-lang/rescript-compiler/issues/856#issuecomment-1483755503 ?
Wow, cool
@cristianoc Could you rebase this? Now that 11.1 is out and development focus is shifting to v12, it would be great to get this merged.
Sorry, I'm afraid you'll also need to rebase again.
@cknitt ready to go