From f8df4df53065fdafc76306e20e5e12b335254042 Mon Sep 17 00:00:00 2001 From: aarne Date: Tue, 15 Feb 2005 10:06:30 +0000 Subject: record type extension freshness check --- src/GF/Compile/CheckGrammar.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/GF/Compile') diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs index eef7a14d9..f4f1ccd40 100644 --- a/src/GF/Compile/CheckGrammar.hs +++ b/src/GF/Compile/CheckGrammar.hs @@ -276,7 +276,7 @@ computeLType gr t = do r' <- comp r s' <- comp s case (r',s') of - (RecType rs, RecType ss) -> return $ RecType (rs ++ ss) + (RecType rs, RecType ss) -> checkErr $ plusRecType r' s' _ -> return $ ExtR r' s' _ | isPredefConstant ty -> return ty @@ -414,9 +414,13 @@ inferLType gr trm = case trm of rT' <- comp rT (s',sT) <- infer s sT' <- comp sT + let trm' = ExtR r' s' + ---- trm' <- checkErr $ plusRecord r' s' case (rT', sT') of - (RecType rs, RecType ss) -> return (trm', RecType (rs ++ ss)) + (RecType rs, RecType ss) -> do + rt <- checkErr $ plusRecType rT' sT' + return (trm', rt) _ | rT' == typeType && sT' == typeType -> return (trm', typeType) _ -> prtFail "records or record types expected in" trm -- cgit v1.2.3