
Indeed you are right, this is not a bug in the type constraints that
#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 gkaracha): Replying to [comment:9 simonpj]: 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
{{{ ... 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
omitted), with `-ddump-ds` and got there'll be a `HsWrapper` involved. Ah, great, thanks! This may be sufficient: I think that `translatePat` in `deSugar/Check.hs` just needs to look at the wrapper in the `CoPat` case then. It already inspects it for dropping trivial coercions, as an optimization. I'll look into it and ping you if anything else gets in the way (I hope not). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12949#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler