Ticket #366 (assigned feature request: None)

Opened 4 years ago

Last modified 2 months ago

incomplete patterns and GADT

Reported by: nobody Assigned to: nobody (accepted)
Priority: normal Milestone: _|_
Component: Compiler Version: None
Severity: minor Keywords:
Cc: jcpetruzza@gmail.com, drl@cs.cmu.edu Difficulty: Unknown
Test Case: tc215 Operating System: Unknown/Multiple
Architecture: Unknown/Multiple

Description (Last modified by igloo)

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

10/20/06 05:26:17 changed by igloo

  • description changed.
  • testcase set to tc215.
  • difficulty set to Unknown.
  • architecture set to Unknown.
  • milestone set to 6.8.
  • os set to Unknown.

10/20/06 07:33:05 changed by igloo

There's another case in 462.

07/03/07 05:39:36 changed by guest

  • cc set to jcpetruzza@gmail.com.

11/05/07 02:09:35 changed by simonpj

  • cc changed from jcpetruzza@gmail.com to jcpetruzza@gmail.com, drl@cs.cmu.edu.
  • milestone changed from 6.8 branch to 6.10 branch.

Dan Licata is planning to work on this.

Simon

07/14/08 07:31:50 changed by simonmar

  • component changed from None to Compiler.
  • milestone changed from 6.10 branch to _|_.

Could be done with #595.

09/30/08 08:37:14 changed by simonmar

  • architecture changed from Unknown to Unknown/Multiple.

09/30/08 08:50:59 changed by simonmar

  • os changed from Unknown to Unknown/Multiple.