[project @ 2001-04-05 11:54:37 by simonpj]
authorsimonpj <unknown>
Thu, 5 Apr 2001 11:54:37 +0000 (11:54 +0000)
committersimonpj <unknown>
Thu, 5 Apr 2001 11:54:37 +0000 (11:54 +0000)
Make type synonyms work right in H98

ghc/compiler/parser/Parser.y
ghc/compiler/rename/RnSource.lhs

index 7631659..d5c3f27 100644 (file)
@@ -1,6 +1,6 @@
 {-
 -----------------------------------------------------------------------------
-$Id: Parser.y,v 1.55 2001/02/26 15:06:59 simonmar Exp $
+$Id: Parser.y,v 1.56 2001/04/05 11:54:37 simonpj Exp $
 
 Haskell grammar.
 
@@ -328,7 +328,11 @@ topdecls :: { [RdrBinding] }
        | topdecl                       { [$1] }
 
 topdecl :: { RdrBinding }
-       : srcloc 'type' simpletype '=' sigtype  
+       : srcloc 'type' simpletype '=' ctype    
+               -- Note ctype, not sigtype.
+               -- We allow an explicit for-all but we don't insert one
+               -- in   type Foo a = (b,b)
+               -- Instead we just say b is out of scope
                { RdrHsDecl (TyClD (TySynonym (fst $3) (snd $3) $5 $1)) }
 
        | srcloc 'data' ctype '=' constrs deriving
index da6a060..e1af3e5 100644 (file)
@@ -315,7 +315,7 @@ rnTyClDecl (TySynonym {tcdName = name, tcdTyVars = tyvars, tcdSynRhs = ty, tcdLo
        -- Silently discard context... but the tyvars in the rest won't be in scope
        -- In interface files all types are quantified, so this is a no-op
     unquantify glaExts (HsForAllTy Nothing ctxt ty) | glaExts = ty
-    unquantify glaExys ty                                    = ty
+    unquantify glaExts ty                                    = ty
 
 rnTyClDecl (ClassDecl {tcdCtxt = context, tcdName = cname, 
                       tcdTyVars = tyvars, tcdFDs = fds, tcdSigs = sigs,