Make error message in solver slightly more specific

This commit is contained in:
Evan Czaplicki 2013-07-19 12:41:37 +02:00
parent b540fb43b0
commit 26738907c6

View file

@ -116,7 +116,8 @@ solve constraint =
CInstance name term -> do
env <- TS.getEnv
freshCopy <- TS.makeInstance (Map.findWithDefault (error $ "Could not find " ++ name ++ " in the environment") name env)
let msg = "Could not find '" ++ name ++ "' when solving type constraints."
freshCopy <- TS.makeInstance (Map.findWithDefault (error msg) name env)
t <- TS.flatten term
unify freshCopy t
TS.getEnv