[GHC] #12949: Pattern coverage mistake

GHC ghc-devs at haskell.org
Fri Jan 13 10:40:22 UTC 2017


#12949: Pattern coverage mistake
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:  gkaracha
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
                                     |  PatternMatchWarnings
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  error/warning at compile-time      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 > Indeed you are right, this is not a bug in the type constraints that the
 checker generates but the term constraints. I expected the knownBools to
 be already desugared to (knownBool $dKnownBool_a) and (knownBool
 $dKnownBool_b) since they are overloaded but I was mistaken.

 I'm going to need more guidance before I can help.  Can you give
 instructions to reproduce the bit you think is unexpected?

 I compiled the program (adding a definition for `Dict` which you omitted),
 with `-ddump-ds` and got
 {{{
 ...
         ds_d3Xn = knownBool @ a $dKnownBool_a3Ux } in
 ...
             ds_d3Xo = knownBool @ b $dKnownBool_a3UL } in

 }}}
 which is what you expect.  This is post-desugaring.  Before desugaring
 there'll be a `HsWrapper` involved.

 Anyway, please show me specifically what you think it unexpected.

 ----------------
 Incidentally, the constraint signatures don't seem to work. Compiling
 {{{
 type T a = Eq a :: Constraint
 }}}
 yields a syntax error, as does
 {{{
 type T a :: Constraint = Eq a
 }}}
 I must be doing something stupid. But what?

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


More information about the ghc-tickets mailing list