on master help sign in
Unbox types safely in --optimize mode

Fix https://github.com/elm/compiler/issues/1836

commita798228fd975b6964a911a8d972a0fd459614f7c authorEvan Czaplicki <evancz@users.noreply.github.com> dateWed 21 Nov 2018, 01:20 (8 years ago) parent1cfe830
1 file changed+7−1
compiler/src/Generate/JavaScript.hs+7−1
compiler/src/Generate/JavaScript.hs+7−1
@@ -209,7 +209,7 @@ addGlobalHelp mode graph global state =
209209 )
210210
211211 Opt.Box ->
212− addStmt state (
212+ addStmt (addGlobal mode graph state identity) (
213213 generateBox mode global
214214 )
215215
@@ -400,6 +400,12 @@ generateBox mode global@(Opt.Global home name) =
400400 JS.Var [ (JsName.fromGlobal home name, Just definition) ]
401401
402402
403+{-# NOINLINE identity #-}
404+identity :: Opt.Global
405+identity =
406+ Opt.Global ModuleName.basics Name.identity
407+
408+
403409
404410-- GENERATE PORTS
405411