Skip to content

Commit e737fab

Browse files
committed
tests
1 parent b26c7d9 commit e737fab

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

jscomp/test/VariantCoercion.js

Lines changed: 18 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/test/VariantCoercion.res

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,17 @@ module CoerceVariants = {
3030
let x: x = One({age: 1})
3131
let y: y = (x :> y)
3232
}
33+
34+
module CoerceWithPayload = {
35+
@unboxed type strings = String(string) | First | Second | Third
36+
let a: strings = String("hello")
37+
let aa: strings = First
38+
let b: string = (a :> string)
39+
let bb: string = (aa :> string)
40+
41+
@unboxed type floats = Number(float) | @as(1.) First | @as(2.) Second | @as(3.) Third
42+
let c: floats = Number(100.)
43+
let cc: floats = Second
44+
let d: float = (c :> float)
45+
let dd: float = (cc :> float)
46+
}

0 commit comments

Comments
 (0)