From: simonpj Date: Thu, 5 Apr 2001 11:54:37 +0000 (+0000) Subject: [project @ 2001-04-05 11:54:37 by simonpj] X-Git-Tag: Approximately_9120_patches~2189 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=197a5ee77b09028ce768a8c3d1eb42fda670e161;p=ghc-hetmet.git [project @ 2001-04-05 11:54:37 by simonpj] Make type synonyms work right in H98 --- diff --git a/ghc/compiler/parser/Parser.y b/ghc/compiler/parser/Parser.y index 7631659..d5c3f27 100644 --- a/ghc/compiler/parser/Parser.y +++ b/ghc/compiler/parser/Parser.y @@ -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 diff --git a/ghc/compiler/rename/RnSource.lhs b/ghc/compiler/rename/RnSource.lhs index da6a060..e1af3e5 100644 --- a/ghc/compiler/rename/RnSource.lhs +++ b/ghc/compiler/rename/RnSource.lhs @@ -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,