Skip to content

Commit 0ba6d8a

Browse files
committed
Add a few more test cases
1 parent d324b07 commit 0ba6d8a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

jscomp/test/VariantCoercion.js

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/test/VariantCoercion.res

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,12 @@ module CoerceVariantBinaryOp = {
125125
type flag = | @as(0) A | @as(2) B
126126

127127
let x = 0->lor((B :> int))
128+
129+
type flagStr = | @as("one") One | @as("two") Two
130+
131+
let y = (One :> string)->String.length
132+
133+
type flagFloat = | @as(1.5) X | @as(2.0) Y
134+
135+
let z = (X :> float) +. (Y :> float) +. 1.5
128136
}

0 commit comments

Comments
 (0)