From c58649bd2972dc088962e87db8ced25e0773dea7 Mon Sep 17 00:00:00 2001 From: hallgren Date: Fri, 4 Apr 2014 13:51:07 +0000 Subject: Removed imports of TypeCheck.Concrete, fixed problems in TypeCheck.RConcrete + The current type checker for concrete syntax is in GF.Compile.TypeCheck.RConcrete, but GF.Compile.TypeCheck.Concrete was still imported in GFI. + Fixed a bug that allowed Ints n as a subtype of Ints m, regardless of m and n. It now requires n<=m. Note: the type checker still allows Int as a subtype of Ints m, regardless of m. + Fixed a potential efficiency problem with large record types, by reducing the number of recursive calls from |R|*|S| to |R| when checking if R<=S. + Fixed a misleading comment: "alpha g t u" checks that u is a subtype of t, the other way around. Similarly, "checkIfEqLType gr g t u trm" checks that u is a subtype of t, not the other way around, and not that t is equal to u. --- src/compiler/GFI.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/compiler/GFI.hs') diff --git a/src/compiler/GFI.hs b/src/compiler/GFI.hs index ead5a3ff7..eb1afd22a 100644 --- a/src/compiler/GFI.hs +++ b/src/compiler/GFI.hs @@ -17,7 +17,7 @@ import GF.Grammar.Lookup (allOpers,allOpersTo) import GF.Compile.Rename(renameSourceTerm) --import GF.Compile.Compute.Concrete (computeConcrete,checkPredefError) import qualified GF.Compile.Compute.ConcreteNew as CN(normalForm,resourceValues) -import GF.Compile.TypeCheck.Concrete (inferLType,ppType) +import GF.Compile.TypeCheck.RConcrete as TC(inferLType,ppType) import GF.Infra.Dependencies(depGraph) import GF.Infra.CheckM import GF.Infra.UseIO(ioErrorText) @@ -226,7 +226,7 @@ execute1 opts gfenv0 s0 = let sigs = [(op,ty) | ((mo,op),ty,pos) <- ops] let printer = if isRaw then showTerm sgr TermPrintDefault Qualified - else (render . GF.Compile.TypeCheck.Concrete.ppType) + else (render . TC.ppType) let printed = [unwords [showIdent op, ":", printer ty] | (op,ty) <- sigs] mapM_ putStrLn [l | l <- printed, all (flip isInfixOf l) greps] continue gfenv -- cgit v1.2.3