summaryrefslogtreecommitdiff
path: root/compiler/parser/RdrHsSyn.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/parser/RdrHsSyn.hs')
-rw-r--r--compiler/parser/RdrHsSyn.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs
index e2943c8001..dc35c124cb 100644
--- a/compiler/parser/RdrHsSyn.hs
+++ b/compiler/parser/RdrHsSyn.hs
@@ -984,12 +984,13 @@ checkAPat msg loc e0 = do
| extopt LangExt.NPlusKPatterns opts && (plus == plus_RDR)
-> return (mkNPlusKPat (L nloc n) (L lloc lit))
- OpApp l op _fix r -> do l <- checkLPat msg l
- r <- checkLPat msg r
- case op of
- L cl (HsVar (L _ c)) | isDataOcc (rdrNameOcc c)
- -> return (ConPatIn (L cl c) (InfixCon l r))
- _ -> patFail msg loc e0
+ OpApp l (L cl (HsVar (L _ c))) _fix r
+ | isDataOcc (rdrNameOcc c) -> do
+ l <- checkLPat msg l
+ r <- checkLPat msg r
+ return (ConPatIn (L cl c) (InfixCon l r))
+
+ OpApp _l _op _fix _r -> patFail msg loc e0
HsPar e -> checkLPat msg e >>= (return . ParPat)
ExplicitList _ _ es -> do ps <- mapM (checkLPat msg) es