sketch-sh icon indicating copy to clipboard operation
sketch-sh copied to clipboard

Reason code doesn't compile when using module and's

Open kyldvs opened this issue 7 years ago • 1 comments

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.

kyldvs avatar Sep 28 '18 02:09 kyldvs

Actually I guess this is not specific to Reason, and happens in .ml too: https://sketch.sh/s/ZcSTYaBFzTlnDFNRikLg9B/

kyldvs avatar Oct 01 '18 06:10 kyldvs

@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).

jchavarri avatar Oct 07 '22 13:10 jchavarri