summaryrefslogtreecommitdiff
path: root/compiler/parser/Parser.y.pp
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/parser/Parser.y.pp')
-rw-r--r--compiler/parser/Parser.y.pp12
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp
index 078cfa4374..e009071ebc 100644
--- a/compiler/parser/Parser.y.pp
+++ b/compiler/parser/Parser.y.pp
@@ -216,7 +216,6 @@ incorrect.
'deriving' { L _ ITderiving }
'do' { L _ ITdo }
'else' { L _ ITelse }
- 'generic' { L _ ITgeneric }
'hiding' { L _ IThiding }
'if' { L _ ITif }
'import' { L _ ITimport }
@@ -722,6 +721,11 @@ decl_cls :: { Located (OrdList (LHsDecl RdrName)) }
decl_cls : at_decl_cls { LL (unitOL (L1 (TyClD (unLoc $1)))) }
| decl { $1 }
+ -- A 'default' signature used with the generic-programming extension
+ | 'default' infixexp '::' sigtypedoc
+ {% do { (TypeSig l ty) <- checkValSig $2 $4
+ ; return (LL $ unitOL (LL $ SigD (GenericSig l ty))) } }
+
decls_cls :: { Located (OrdList (LHsDecl RdrName)) } -- Reversed
: decls_cls ';' decl_cls { LL (unLoc $1 `appOL` unLoc $3) }
| decls_cls ';' { LL (unLoc $1) }
@@ -1233,11 +1237,9 @@ gdrh :: { LGRHS RdrName }
: '|' guardquals '=' exp { sL (comb2 $1 $>) $ GRHS (unLoc $2) $4 }
sigdecl :: { Located (OrdList (LHsDecl RdrName)) }
- : 'generic' infixexp '::' sigtypedoc
- {% do (TypeSig l ty) <- checkValSig $2 $4
- ; return (LL $ unitOL (LL $ SigD (GenericSig l ty))) }
+ :
-- See Note [Declaration/signature overlap] for why we need infixexp here
- | infixexp '::' sigtypedoc
+ infixexp '::' sigtypedoc
{% do s <- checkValSig $1 $3
; return (LL $ unitOL (LL $ SigD s)) }
| var ',' sig_vars '::' sigtypedoc