diff options
Diffstat (limited to 'compiler/parser/Parser.y')
-rw-r--r-- | compiler/parser/Parser.y | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 898ed3c5ae..bdb5e6b479 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -1373,10 +1373,11 @@ capi_ctype : '{-# CTYPE' STRING STRING '#-}' -- Glasgow extension: stand-alone deriving declarations stand_alone_deriving :: { LDerivDecl GhcPs } - : 'deriving' deriv_strategy 'instance' overlap_pragma inst_type + : 'deriving' deriv_strategy 'instance' overlap_pragma sigtype {% do { let { err = text "in the stand-alone deriving instance" - <> colon <+> quotes (ppr $5) } - ; ams (sLL $1 (hsSigType $>) (DerivDecl $5 $2 $4)) + <> colon <+> quotes (ppr $5) + ; inst_ty = mkLHsSigWcType $5 } + ; ams (sLL $1 $> (DerivDecl inst_ty $2 $4)) [mj AnnDeriving $1, mj AnnInstance $3] } } ----------------------------------------------------------------------------- |