syntax
syntax copied to clipboard
File converted from Reason to Rescript using bsc -format does not compile and Reason syntax not expressible in Rescript
Reason file:
let f: unit => [ | `A] = () => `A;
let g: unit => [ | `B] = () => `B;
let h = b =>
if (b) {
(f(): [ | `A] :> [> | `A]);
} else {
(g(): [ | `B] :> [> | `B]);
};
Rescript file:
let f: unit => [#A] = () => #A
let g: unit => [#B] = () => #B
let h = b =>
if b {
(f(): [#A] :> [> #A])
} else {
(g(): [#B] :> [> #B])
}
Error:
Type Errors
[E] Line 8, column 5:
This has type: [#B]
Somewhere wanted: [#A]
These two variant types have no intersection