Improve error message a bit
authorunc0rr
Fri, 30 Mar 2018 20:42:24 +0200
changeset 13311 806347b3c978
parent 13310 859643473ef2
child 13312 1b409f2add34
Improve error message a bit
tools/pas2c/Pas2C.hs
--- a/tools/pas2c/Pas2C.hs	Fri Mar 30 12:26:51 2018 -0400
+++ b/tools/pas2c/Pas2C.hs	Fri Mar 30 20:42:24 2018 +0200
@@ -1098,7 +1098,7 @@
          BTString -> f "fpcrtl_copy"
          BTAString -> f "fpcrtl_copyA"
          _ -> error $ "copy() called on " ++ show lt
-     
+
 expr2C (BuiltInFunCall params ref) = do
     r <- ref2C ref
     t <- gets lastType
@@ -1106,7 +1106,7 @@
     case t of
         BTFunction _ _ _ t' -> do
             modify (\s -> s{lastType = t'})
-        _ -> error $ "BuiltInFunCall lastType: " ++ show t
+        _ -> error $ "BuiltInFunCall `" ++ show ref ++ "`, lastType: " ++ show t
     return $
         r <> parens (hsep . punctuate (char ',') $ ps)
 expr2C a = error $ "Don't know how to render " ++ show a