[GHC] #7294: -fdefer-type-errors doesn't produce a warning

GHC cvs-ghc at haskell.org
Wed Oct 3 15:05:00 CEST 2012


#7294: -fdefer-type-errors doesn't produce a warning
-----------------------------------------+----------------------------------
 Reporter:  Feuerbach                    |          Owner:                  
     Type:  bug                          |         Status:  new             
 Priority:  normal                       |      Component:  Compiler        
  Version:  7.6.1                        |       Keywords:                  
       Os:  Unknown/Multiple             |   Architecture:  Unknown/Multiple
  Failure:  GHC accepts invalid program  |       Testcase:                  
Blockedby:                               |       Blocking:                  
  Related:                               |  
-----------------------------------------+----------------------------------
 With the attached code I get the expected error

 {{{
 sing.hs:20:8:
     Couldn't match type 'False with 'True
     Inaccessible code in
       the type signature for
         nth :: (k :< n) ~ 'True => Vec a n -> SNat k -> a
 }}}

 However, if I compile with -fdefer-type-errors, compilation goes clean
 without any errors or warnings.

 Also, if I comment out the last line (with inaccessible code) and compile
 with -fforce-recomp -fwarn-incomplete-patterns, then I get a false warning
 {{{
 sing.hs:21:1: Warning:
     Pattern match(es) are non-exhaustive
     In an equation for `nth': Patterns not matched: Nil _
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7294>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list