summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2006-05-30 12:19:19 +0000
committeraarne <aarne@cs.chalmers.se>2006-05-30 12:19:19 +0000
commit5dc1edf50f5c6ae4d0a9ac1c7ff45d95da1a61e2 (patch)
tree6e9c48ba42996b680d0d656db0b7cf803d8f7f6e
parente9ce09cb450158febbe0e9ecb95ba4ffef51aeb8 (diff)
lincat typecheck and abstract-interface extension fixed
-rw-r--r--src/GF/Compile/CheckGrammar.hs1
-rw-r--r--src/GF/Compile/ModDeps.hs3
-rw-r--r--src/GF/Infra/Modules.hs20
3 files changed, 16 insertions, 8 deletions
diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs
index 96c4a1a9d..5360840c7 100644
--- a/src/GF/Compile/CheckGrammar.hs
+++ b/src/GF/Compile/CheckGrammar.hs
@@ -214,6 +214,7 @@ checkCncInfo gr m (a,abs) (c,info) = do
-- cat for cf, typ for pe
CncCat (Yes typ) mdef mpr -> chIn "linearization type of" $ do
+ checkErr $ lookupCatContextSrc gr a c
typ' <- checkIfLinType gr typ
mdef' <- case mdef of
Yes def -> do
diff --git a/src/GF/Compile/ModDeps.hs b/src/GF/Compile/ModDeps.hs
index 737c7e4c1..8331057d1 100644
--- a/src/GF/Compile/ModDeps.hs
+++ b/src/GF/Compile/ModDeps.hs
@@ -93,6 +93,9 @@ moduleDeps ms = mapM deps ms where
-- check for superficial compatibility, not submodule relation etc: what can be extended
compatMType mt0 mt = case (mt0,mt) of
+ (MTResource, MTConcrete _) -> True
+ (MTInstance _, MTConcrete _) -> True
+ (MTInterface, MTAbstract) -> True
(MTConcrete _, MTConcrete _) -> True
(MTInstance _, MTInstance _) -> True
(MTReuse _, MTReuse _) -> True
diff --git a/src/GF/Infra/Modules.hs b/src/GF/Infra/Modules.hs
index 3f61247a5..0cff03328 100644
--- a/src/GF/Infra/Modules.hs
+++ b/src/GF/Infra/Modules.hs
@@ -343,16 +343,20 @@ isModTrans m = case mtype m of
_ -> False
sameMType :: Eq i => ModuleType i -> ModuleType i -> Bool
-sameMType m n = case (m,n) of
+sameMType m n = case (n,m) of
(MTConcrete _, MTConcrete _) -> True
+
(MTInstance _, MTInstance _) -> True
- (MTInstance _, MTResource) -> True
- (MTInstance _, MTInterface) -> True
- (MTResource, MTInstance _) -> True
- (MTResource, MTInterface) -> True
- (MTAbstract, MTInterface) -> True -- for reuse
- (MTConcrete _, MTResource) -> True -- for reuse
- (MTInterface,MTResource) -> True
+ (MTInstance _, MTResource) -> True
+ (MTInstance _, MTConcrete _) -> True
+
+ (MTInterface, MTInstance _) -> True
+ (MTInterface, MTResource) -> True -- for reuse
+ (MTInterface, MTAbstract) -> True -- for reuse
+
+ (MTResource, MTInstance _) -> True
+ (MTResource, MTConcrete _) -> True -- for reuse
+
_ -> m == n
-- | don't generate code for interfaces and for incomplete modules