shithub: MicroHs

Download patch

ref: 1e966c164229f6c68b3c911bfe2da67ade0290aa
parent: d52d68c288ece685d789c4ee91ae54be0fe9d14f
author: Lennart Augustsson <lennart.augustsson@epicgames.com>
date: Fri Feb 2 13:00:45 EST 2024

More import checks.

--- a/src/MicroHs/TypeCheck.hs
+++ b/src/MicroHs/TypeCheck.hs
@@ -110,11 +110,15 @@
   [ValueExport]   -- associated values, i.e., constructors, selectors, methods
 --  deriving (Show)
 
+--instance Show TypeExport where show (TypeExport i _ vs) = showIdent i ++ show vs
+
 data ValueExport = ValueExport
   Ident           -- unqualified name
   Entry           -- symbol table entry
 --  deriving (Show)
 
+--instance Show ValueExport where show (ValueExport i _) = showIdent i
+
 type FixDef = (Ident, Fixity)
 type SynDef = (Ident, EType)
 type ClsDef = (Ident, ClassInfo)
@@ -169,9 +173,12 @@
           map (\ te@(TypeExport i e _) -> if keep i cts then te else TypeExport i e []) $
           filter (\ (TypeExport i _ _) -> keep i its) ts
     msg = "not exported"
+    allVs = map (\ (ValueExport i _) -> i) vs ++
+            concatMap (\ (TypeExport _ _ xvs) -> map (\ (ValueExport i _) -> i) xvs) ts
+    allTs = map (\ (TypeExport i _ _) -> i) ts
   in
-    checkBad msg (ivs \\ map (\ (ValueExport i _) -> i) vs) $
-    checkBad msg (its \\ map (\ (TypeExport i _ _) -> i) ts) $
+    checkBad msg (ivs \\ allVs) $
+    checkBad msg (its \\ allTs) $
     --trace (show (ts, vs)) $
     (imp, TModule mn fx ts' ss cs ins vs' a)
 
--