Skip to content

Commit 759108b

Browse files
committed
Proper union type optimization (2)
1 parent 1d5b70f commit 759108b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Targets/ReScript/Writer.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ and emitUnion (flags: EmitTypeFlags) (overrideFunc: OverrideFunc) (ctx: Context)
426426

427427
match List.distinct baseTypes with
428428
| [] -> ()
429+
| [t] -> yield case "Other" (Some t)
429430
| ts ->
430431
if unwrap then
431432
for i, t in ts |> List.indexed do

0 commit comments

Comments
 (0)