[Git][ghc/ghc][master] PmCheck: Print types of uncovered patterns (#18932)

Marge Bot gitlab at gitlab.haskell.org
Thu Nov 19 04:38:47 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
8150f654 by Sebastian Graf at 2020-11-18T23:38:40-05:00
PmCheck: Print types of uncovered patterns (#18932)

In order to avoid confusion as in #18932, we display the type of the
match variables in the non-exhaustiveness warning, e.g.

```
T18932.hs:14:1: warning: [-Wincomplete-patterns]
    Pattern match(es) are non-exhaustive
    In an equation for ‘g’:
        Patterns of type  ‘T a’, ‘T a’, ‘T a’ not matched:
            (MkT2 _) (MkT1 _) (MkT1 _)
            (MkT2 _) (MkT1 _) (MkT2 _)
            (MkT2 _) (MkT2 _) (MkT1 _)
            (MkT2 _) (MkT2 _) (MkT2 _)
            ...
   |
14 | g (MkT1 x) (MkT1 _) (MkT1 _) = x
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

It also allows us to omit the type signature on wildcard matches which
we previously showed in only some situations, particularly
`-XEmptyCase`.

Fixes #18932.

- - - - -


30 changed files:

- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Pmc/Ppr.hs
- testsuite/tests/deSugar/should_compile/DsStrictWarn.stderr
- testsuite/tests/deSugar/should_compile/GadtOverlap.stderr
- testsuite/tests/deSugar/should_compile/T14135.stderr
- testsuite/tests/deSugar/should_compile/T14546a.stderr
- testsuite/tests/deSugar/should_compile/T14546d.stderr
- testsuite/tests/deSugar/should_compile/T5455.stderr
- testsuite/tests/dependent/should_compile/KindEqualities.stderr
- testsuite/tests/driver/T8101.stderr
- testsuite/tests/driver/T8101b.stderr
- testsuite/tests/driver/werror.stderr
- testsuite/tests/ghci/prog018/prog018.stdout
- testsuite/tests/parser/should_compile/T15139.stderr
- testsuite/tests/pmcheck/complete_sigs/T13964.stderr
- testsuite/tests/pmcheck/complete_sigs/T14059a.stderr
- testsuite/tests/pmcheck/complete_sigs/T17386.stderr
- testsuite/tests/pmcheck/complete_sigs/completesig02.stderr
- testsuite/tests/pmcheck/complete_sigs/completesig04.stderr
- testsuite/tests/pmcheck/complete_sigs/completesig06.stderr
- testsuite/tests/pmcheck/complete_sigs/completesig07.stderr
- testsuite/tests/pmcheck/complete_sigs/completesig10.stderr
- testsuite/tests/pmcheck/complete_sigs/completesig11.stderr
- testsuite/tests/pmcheck/should_compile/EmptyCase001.stderr
- testsuite/tests/pmcheck/should_compile/EmptyCase002.stderr
- testsuite/tests/pmcheck/should_compile/EmptyCase003.stderr
- testsuite/tests/pmcheck/should_compile/EmptyCase004.stderr
- testsuite/tests/pmcheck/should_compile/EmptyCase005.stderr
- testsuite/tests/pmcheck/should_compile/EmptyCase006.stderr
- testsuite/tests/pmcheck/should_compile/EmptyCase007.stderr


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8150f6546e6fd0006252e245d5697f13ffd8ce3e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8150f6546e6fd0006252e245d5697f13ffd8ce3e
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201118/1399f8f5/attachment.html>


More information about the ghc-commits mailing list