diff options
author | Sebastian Graf <sebastian.graf@kit.edu> | 2020-04-29 16:44:11 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-05-01 10:38:16 -0400 |
commit | 8b51fcbd67ca17a6dcc2f9e5a29176f836bf11d2 (patch) | |
tree | 80190649a58f0e282f7456ee1b1a9220d37ab99e /compiler/GHC/HsToCore | |
parent | de9fc995c2170bc34600ee3fc80393c67cfecad1 (diff) | |
download | haskell-8b51fcbd67ca17a6dcc2f9e5a29176f836bf11d2.tar.gz |
PmCheck: Only call checkSingle if we would report warnings
Diffstat (limited to 'compiler/GHC/HsToCore')
-rw-r--r-- | compiler/GHC/HsToCore/Match.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/GHC/HsToCore/Match.hs b/compiler/GHC/HsToCore/Match.hs index 60b694ff9d..55f2709cf9 100644 --- a/compiler/GHC/HsToCore/Match.hs +++ b/compiler/GHC/HsToCore/Match.hs @@ -859,8 +859,10 @@ matchSinglePatVar var ctx pat ty match_result do { dflags <- getDynFlags ; locn <- getSrcSpanDs - -- Pattern match check warnings - ; checkSingle dflags (DsMatchContext ctx locn) var (unLoc pat) + -- Pattern match check warnings + ; if isMatchContextPmChecked dflags FromSource ctx + then checkSingle dflags (DsMatchContext ctx locn) var (unLoc pat) + else pure () ; let eqn_info = EqnInfo { eqn_pats = [unLoc (decideBangHood dflags pat)] , eqn_orig = FromSource |