diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/jscomp.sml | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml index 7a6c3094..0ebdc94a 100644 --- a/src/jscomp.sml +++ b/src/jscomp.sml @@ -301,12 +301,18 @@ fun process file = [((PNone rt, loc), str loc "null"), ((PSome (rt, (PVar ("x", rt), loc)), loc), - strcat loc [str loc "{v:{_1:", + strcat loc [str loc ((if isNullable t' then + "{v:" + else + "") ^ "{_1:"), e', str loc ",_2:", (EApp ((ENamed n', loc), (EField ((ERel 0, loc), "2"), loc)), loc), - str loc "}}"])], + str loc ((if isNullable t' then + "}" + else + "") ^ "}")])], {disc = t, result = s}), loc) val body = (EAbs ("x", t, s, body), loc) |