sketch-sh
sketch-sh copied to clipboard
Reason code doesn't compile when using module and's
https://sketch.sh/s/iEUvSvOSo6uHgywRCaoeDY/
This code always has an error in the console, uncaught exception: 248,Misc.Fatal_error,16
module rec Foo : {
type t =
| Foo1
| Foo2;
} = Foo
and Bar : {
type t =
| Bar1
| Bar2;
} = Bar;
let x: Bar.t = Bar1;
It seems to work if I run it locally though, so I think it's valid.
Actually I guess this is not specific to Reason, and happens in .ml too: https://sketch.sh/s/ZcSTYaBFzTlnDFNRikLg9B/
@kyldvs thanks for the report.
Pasting your snippets in a new sketch, which uses OCaml 4.13, seems to work fine.
https://sketch.sh/s/63E9bzRqnuU70zNZUTwq6I/ https://sketch.sh/s/ezvR9WzESj3fUfZnSuxNQW/
To migrate your sketches, just copy/paste them into a new sketch (unfortunately there is no way to migrate the version of the compiler for existing sketches).