on master help sign in
Marginally better errors when a variable is undefined.
commit901179c10f25f0e362a9acbfc015a9dbcafdb88d authorEvan Czaplicki <info@elm-lang.org> dateWed 17 Jul 2013, 19:30 (13 years ago) parenta3a7b3e
1 file changed+1−1
compiler/Type/Solve.hs+1−1
compiler/Type/Solve.hs+1−1
@@ -116,7 +116,7 @@ solve constraint =
116116
117117 CInstance name term -> do
118118 env <- TS.getEnv
119− freshCopy <- TS.makeInstance ((Map.!) env name)
119+ freshCopy <- TS.makeInstance (Map.findWithDefault (error $ "Could not find " ++ name ++ " in the environment") name env)
120120 t <- TS.flatten term
121121 unify freshCopy t
122122 TS.getEnv