[GHC] #13965: COMPLETE sets nerf redundant pattern-match warnings

GHC ghc-devs at haskell.org
Mon Sep 10 13:09:15 UTC 2018


#13965: COMPLETE sets nerf redundant pattern-match warnings
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1-rc2
      Resolution:                    |             Keywords:
                                     |  PatternSynonyms,
                                     |  PatternMatchWarnings
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 I think this comparison is somewhat unfair. For one thing, this isn't even
 a situation where the `COMPLETE` set would kick in, since GHC would pick
 the original set of constructors over the `COMPLETE` set. Removing the
 "redundant" match on `B` wouldn't introduce any warnings either, but that
 is correct behavior, since now GHC uses the `COMPLETE` set.

 The original program is of a different nature, since the only option it
 has is a `COMPLETE` set (as evidenced by `module Foo`). Moreover, removing
 the redundant match on `F` doesn't change the fact that GHC is using the
 same `COMPLETE` set. This is why I argue that GHC's warning behavior on
 the original program is mistaken, since the second match on `F` is truly
 redundant, even after factoring in the semantics of `COMPLETE` sets.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13965#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list