on master help sign in
Detect crashes, add region information
commitff98144eb07ae36cac4bbfc526ba20a49961cae9 authorEvan Czaplicki <info@elm-lang.org> dateFri 4 Sep 2015, 19:35 (11 years ago) parent16c4b79
1 file changed+5−1
src/Optimize.hs+5−1
src/Optimize.hs+5−1
@@ -194,7 +194,11 @@ optimizeExpr context annExpr@(A.A region expression) =
194194 pure (Opt.Literal lit)
195195
196196 Expr.Var name ->
197− pure (Opt.Var name)
197+ if name == Var.inCore ["Debug"] "crash" then
198+ pure (Opt.Crash region Nothing)
199+
200+ else
201+ pure (Opt.Var name)
198202
199203 Expr.Range lowExpr highExpr ->
200204 Opt.Range