on master help sign in
Unbox types safely in --optimize mode
a798228Evan Czaplicki
compiler/src/Generate/JavaScript.hs+7−1
@@ -209,7 +209,7 @@ addGlobalHelp mode graph global state =
209 )
209 )
210
210
211 Opt.Box ->
211 Opt.Box ->
212− addStmt state (
212+ addStmt (addGlobal mode graph state identity) (
213 generateBox mode global
213 generateBox mode global
214 )
214 )
215
215
@@ -400,6 +400,12 @@ generateBox mode global@(Opt.Global home name) =
400 JS.Var [ (JsName.fromGlobal home name, Just definition) ]
400 JS.Var [ (JsName.fromGlobal home name, Just definition) ]
401
401
402
402
403+{-# NOINLINE identity #-}
404+identity :: Opt.Global
405+identity =
406+ Opt.Global ModuleName.basics Name.identity
407+
408+
403
409
404-- GENERATE PORTS
410-- GENERATE PORTS
405
411