diff options
| author | aarne <aarne@chalmers.se> | 2010-03-31 22:05:12 +0000 |
|---|---|---|
| committer | aarne <aarne@chalmers.se> | 2010-03-31 22:05:12 +0000 |
| commit | 5dfda62ad10639d1493ed57d709786ad9291bec1 (patch) | |
| tree | 9317b805c4c034f9aed142af749d66679baff57a /src/compiler/GF/Compile | |
| parent | fb0f77b6f11edb483fd79ee2a77c9cb0b7e059b1 (diff) | |
fixed a deep bug in TypeCheck due to swap of arguments; print empty record as <> instead of {} to distinguish from empty record type
Diffstat (limited to 'src/compiler/GF/Compile')
| -rw-r--r-- | src/compiler/GF/Compile/Concrete/TypeCheck.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/compiler/GF/Compile/Concrete/TypeCheck.hs b/src/compiler/GF/Compile/Concrete/TypeCheck.hs index 670f36625..eafa0dbd7 100644 --- a/src/compiler/GF/Compile/Concrete/TypeCheck.hs +++ b/src/compiler/GF/Compile/Concrete/TypeCheck.hs @@ -256,7 +256,7 @@ inferLType gr g trm = case trm of -- for record fields, which may be typed inferM (mty, t) = do (t', ty') <- case mty of - Just ty -> checkLType gr g ty t + Just ty -> checkLType gr g t ty _ -> inferLType gr g t return (Just ty',t') @@ -431,6 +431,7 @@ checkLType gr g trm typ0 = do ExtR (Vr _) (RecType _) -> termWith trm $ return typeType -- ext t = t ** ... _ -> checkError (text "invalid record type extension" <+> nest 2 (ppTerm Unqualified 0 trm)) + RecType rr -> do (r',ty,s') <- checks [ do (r',ty) <- inferLType gr g r @@ -438,7 +439,8 @@ checkLType gr g trm typ0 = do , do (s',ty) <- inferLType gr g s return (s',ty,r) - ] + ] + case ty of RecType rr1 -> do let (rr0,rr2) = recParts rr rr1 @@ -451,7 +453,7 @@ checkLType gr g trm typ0 = do ExtR ty ex -> do r' <- justCheck g r ty s' <- justCheck g s ex - return $ (ExtR r' s', typ) --- is this all? + return $ (ExtR r' s', typ) --- is this all? it assumes the same division in trm and typ _ -> checkError (text "record extension not meaningful for" <+> ppTerm Unqualified 0 typ) |
