Commit 56dfaffd authored by simonpj@microsoft.com's avatar simonpj@microsoft.com

Enable bang-patterns only when the flag says so (had missed a case before)

parent edbfd324
......@@ -530,8 +530,12 @@ checkAPat loc e = case e of
NegApp (L _ (HsOverLit pos_lit)) _
-> return (mkNPat pos_lit (Just noSyntaxExpr))
SectionR (L _ (HsVar bang)) e
| bang == bang_RDR -> checkLPat e >>= (return . BangPat)
SectionR (L _ (HsVar bang)) e -- (! x)
| bang == bang_RDR
-> do { bang_on <- extension bangPatEnabled
; if bang_on then checkLPat e >>= (return . BangPat)
else parseError loc "Illegal bang-pattern (use -fbang-patterns)" }
ELazyPat e -> checkLPat e >>= (return . LazyPat)
EAsPat n e -> checkLPat e >>= (return . AsPat n)
ExprWithTySig e t -> checkLPat e >>= \e ->
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment