Ticket #366 (closed feature request: fixed)
incomplete patterns and GADT
| Reported by: | nobody | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | _|_ |
| Component: | Compiler | Version: | None |
| Keywords: | Cc: | jcpetruzza@…, drl@… | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | tc215, deSugar/should_compile/GadtOverlap | Blocked By: | |
| Blocking: | Related Tickets: |
Description (last modified by igloo) (diff)
I would like to compile with
-fwarn-incomplete-patterns and use GADTs,
but I have bogus error messages.
Suppose I define :
data T a where
C1 :: T Char
C2 :: T Float
then a function :
exhaustive :: T Char -> Char
exhaustive C1 = ' '
If I compile with incomplete pattern warnings,
I get that my function "exhaustive" is not
exhaustive.
But if I add a case :
exhaust C2 = ' '
then the compiler accurately warns me that this
case is inaccessible.
Would it be possible to add the accessibility check
when compiling with incomplete patterns detection ?
Change History
Note: See
TracTickets for help on using
tickets.
