Unbox types safely in --optimize mode

Fix https://github.com/elm/compiler/issues/1836
This commit is contained in:
Evan Czaplicki 2018-11-21 01:20:36 -05:00
parent 1cfe830903
commit a798228fd9

View File

@ -209,7 +209,7 @@ addGlobalHelp mode graph global state =
)
Opt.Box ->
addStmt state (
addStmt (addGlobal mode graph state identity) (
generateBox mode global
)
@ -400,6 +400,12 @@ generateBox mode global@(Opt.Global home name) =
JS.Var [ (JsName.fromGlobal home name, Just definition) ]
{-# NOINLINE identity #-}
identity :: Opt.Global
identity =
Opt.Global ModuleName.basics Name.identity
-- GENERATE PORTS