diff options
Diffstat (limited to 'compiler/GHC/Parser.y')
-rw-r--r-- | compiler/GHC/Parser.y | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/GHC/Parser.y b/compiler/GHC/Parser.y index 7cc43b7273..2648552bee 100644 --- a/compiler/GHC/Parser.y +++ b/compiler/GHC/Parser.y @@ -2263,6 +2263,10 @@ atype :: { LHsType GhcPs } | STRING { reLocA $ sLL $1 $> $ HsTyLit noExtField $ HsStrTy (getSTRINGs $1) (getSTRING $1) } | '_' { reLocA $ sL1 $1 $ mkAnonWildCardTy } + -- Type variables are never exported, so `M.tyvar` will be rejected by the renamer. + -- We let it pass the parser because the renamer can generate a better error message. + | QVARID {% let qname = mkQual tvName (getQVARID $1) + in acsa (\cs -> sL1a $1 (HsTyVar (EpAnn (glR $1) [] cs) NotPromoted (sL1n $1 $ qname)))} -- An inst_type is what occurs in the head of an instance decl -- e.g. (Foo a, Gaz b) => Wibble a b |