1
0
forked from GitHub/gf-core

record type extension freshness check

This commit is contained in:
aarne
2005-02-15 10:06:30 +00:00
parent 0c4ae414ef
commit fa87001298
9 changed files with 107 additions and 60 deletions

View File

@@ -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