on master help sign in
Make error message in solver slightly more specific
2673890Evan Czaplicki
compiler/Type/Solve.hs+2−1
@@ -116,7 +116,8 @@ solve constraint =
116
116
117 CInstance name term -> do
117 CInstance name term -> do
118 env <- TS.getEnv
118 env <- TS.getEnv
119+ let msg = "Could not find '" ++ name ++ "' when solving type constraints."
119− freshCopy <- TS.makeInstance (Map.findWithDefault (error $ "Could not find " ++ name ++ " in the environment") name env)
120+ freshCopy <- TS.makeInstance (Map.findWithDefault (error msg) name env)
120 t <- TS.flatten term
121 t <- TS.flatten term
121 unify freshCopy t
122 unify freshCopy t
122 TS.getEnv
123 TS.getEnv