shithub: MicroHs

Download patch

ref: 38c8119d596cf802907b197602382d4ae83e545c
parent: afef0037c15508bafa7e692fc9608fafa3a802ba
author: Lennart Augustsson <lennart@augustsson.net>
date: Thu Dec 26 12:13:35 EST 2024

Get the Entry correct for patsyn

--- a/src/MicroHs/TypeCheck.hs
+++ b/src/MicroHs/TypeCheck.hs
@@ -297,7 +297,11 @@
       case stLookup "" (qualIdent mn i) tt of
         Right e -> e
         _       -> impossible
-          -- error $ show (qualIdent mn i, M.toList tt)
+    ventry i t =
+      let qi = qualIdent mn i in
+      case stLookup "" qi vt of
+        Right e -> e
+        _       -> Entry (EVar qi) t  -- XXX A hack for boot modules
           
     -- Find all value Entry for names associated with a type.
     assoc i = case impt of
@@ -305,7 +309,7 @@
                 _ -> getAssocs vt at (qualIdent mn i)
 
     -- All top level values possible to export.
-    ves = [ ValueExport i (Entry (EVar (qualIdent mn i)) ts) | Sign is ts <- tds, i <- is ]
+    ves = [ ValueExport i (ventry i t) | Sign is t <- tds, i <- is ]
 
     -- All top level types possible to export.
     tes =