From a34eed5189ab21d08cecc7171815bb51f7ff18b9 Mon Sep 17 00:00:00 2001 From: aarne Date: Sun, 9 Mar 2008 12:17:42 +0000 Subject: lincat can now be just Str --- src/GF/Devel/CheckGrammar.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/GF/Devel/CheckGrammar.hs') diff --git a/src/GF/Devel/CheckGrammar.hs b/src/GF/Devel/CheckGrammar.hs index 4ad308366..f0ec8318c 100644 --- a/src/GF/Devel/CheckGrammar.hs +++ b/src/GF/Devel/CheckGrammar.hs @@ -311,13 +311,15 @@ checkIfStrType st typ = case typ of checkIfLinType :: SourceGrammar -> Type -> Check Type checkIfLinType st typ0 = do typ <- computeLType st typ0 +{- ---- should check that not fun type case typ of RecType r -> do let (lins,ihs) = partition (isLinLabel .fst) r --- checkErr $ checkUnique $ map fst r mapM_ checkInh ihs mapM_ checkLin lins - _ -> prtFail "a linearization type must be a record type instead of" typ + _ -> prtFail "a linearization type cannot be" typ +-} return typ where @@ -1037,7 +1039,8 @@ linTypeOfType cnc m typ = do val <- lookLin mc let vars = mkRecType varLabel $ replicate n typeStr symb = argIdent n cat i - rec <- checkErr $ errIn ("extending" +++ prt vars +++ "with" +++ prt val) $ + rec <- if n==0 then return val else + checkErr $ errIn ("extending" +++ prt vars +++ "with" +++ prt val) $ plusRecType vars val return (symb,rec) lookLin (_,c) = checks [ --- rather: update with defLinType ? -- cgit v1.2.3