The following program:
type state =
| Empty
| Int1(int)
| Int2(int);
let func = (state: state): int => {
switch (state) {
| Empty => 0
| Int2(intValue) | Int1(intValue) =>
let intFunc = intParam => intParam + intValue;
intFunc(0)
};
};
Produces this unexpected error:
Fatal error: exception Failure("File \"lam_dce.ml\", line 46, characters 40-47intValue/1014 not found")
I'm using bs-platform 5.0.4 on MacOS v 10.14.4.
Here is a git repository I prepared for the purposes of demonstrating the problem.
I'm think this is the correct place to report this problem, because of this similar
(but different) bug report from 2017.
I'm able to work around the problem when I change the code like this:
type state =
| Empty
| Int1(int)
| Int2(int);
let func = (state: state): int => {
switch (state) {
| Empty => 0
| Int1(intValue) =>
let intFunc = intParam => intParam + intValue;
intFunc(0)
| Int2(intValue) =>
let intFunc = intParam => intParam + intValue;
intFunc(0)
};
};
fixed in #3614 sorry for the embarrassing bug
Thanks for rapid response. I'm enjoying my first experiences with Reason and this definitely counts as the positive ones :)
Most helpful comment
fixed in #3614 sorry for the embarrassing bug