Fixed a problem where operators with % in the name were screwing up an error message

This commit is contained in:
Neil Brown 2009-04-10 16:06:49 +00:00
parent 2308c6571c
commit e53da5822f
2 changed files with 4 additions and 1 deletions

View File

@ -693,6 +693,9 @@ instance ShowRain A.Replicator where
instance Data a => ShowRain a where
showRainM = tell . singleton . gshow
instance ShowOccam String where
showOccamM s = tell [s]
instance ShowOccam a => ShowOccam [a] where
showOccamM xs = tell ["["] >> sequence (intersperse (tell [", "]) $ map
showOccamM xs) >> tell ["]"]

View File

@ -742,7 +742,7 @@ inferTypes = occamOnlyPass "Infer types"
, ts `typesEqForOp` tes
]
case possibles of
[] -> diePC m $ formatCode ("No matching " ++ opDescrip ++ " operator definition found for types: %") tes
[] -> diePC m $ formatCode "No matching % operator definition found for types: %" opDescrip tes
[poss] -> return $ fst poss
posss -> dieP m $ "Ambigious " ++ opDescrip ++ " operator, matches definitions: "
++ show (map (transformPair (A.nameMeta . fst) showOccam) posss)