shithub: MicroHs

Download patch

ref: 0e97b2fe95f3096fbda442b3f72ad3e8b1c3921f
parent: ddd61eb53798bbb46bf7b638777a3dc2cc279781
author: Lennart Augustsson <lennart.augustsson@epicgames.com>
date: Fri Oct 20 06:18:22 EDT 2023

Better error message

--- a/src/MicroHs/Ident.hs
+++ b/src/MicroHs/Ident.hs
@@ -38,7 +38,7 @@
 noSLoc = SLoc "" 0 0
 
 isNoSLoc :: SLoc -> Bool
-isNoSLoc (SLoc "" 0 0) = True
+isNoSLoc (SLoc _ 0 0) = True
 isNoSLoc _ = False
 
 mkIdent :: String -> Ident
--- a/src/MicroHs/TypeCheck.hs
+++ b/src/MicroHs/TypeCheck.hs
@@ -693,10 +693,11 @@
     _ -> T.return et
 
 tDict :: (Expr, EType) -> T (Expr, EType)
-tDict (ae, EApp (EApp (EVar (Ident loc "Primitives.=>")) ctx) t) = T.do
+tDict (ae, EApp (EApp (EVar (Ident _ "Primitives.=>")) ctx) t) = T.do
   u <- newUniq
   let d = mkIdentSLoc loc ("dict$" ++ showInt u)
-  --traceM $ "addConstraint: " ++ showIdent d ++ " :: " ++ showEType ctx
+      loc = getSLocExpr ae
+  --traceM $ "addConstraint: " ++ showIdent d ++ " :: " ++ showEType ctx ++ " " ++ showSLoc loc
   ctx' <- expandSyn ctx
   addConstraint "from tDict " (d, ctx')
   tDict (EApp ae (EVar d), t)
--