[GHC] #7082: Default type family instances

GHC cvs-ghc at haskell.org
Wed Jul 18 14:02:46 CEST 2012


#7082: Default type family instances
-------------------------------------------------+--------------------------
  Reporter:  guest                               |          Owner:                  
      Type:  bug                                 |         Status:  closed          
  Priority:  normal                              |      Milestone:                  
 Component:  Compiler (Type checker)             |        Version:  7.4.1           
Resolution:  fixed                               |       Keywords:                  
        Os:  Unknown/Multiple                    |   Architecture:  Unknown/Multiple
   Failure:  GHC rejects valid program           |     Difficulty:  Unknown         
  Testcase:  indexed-types/should_compile/T7082  |      Blockedby:                  
  Blocking:                                      |        Related:                  
-------------------------------------------------+--------------------------
Changes (by simonpj):

  * status:  new => closed
  * difficulty:  => Unknown
  * resolution:  => fixed
  * testcase:  => indexed-types/should_compile/T7082


Comment:

 Happily this works fine in HEAD.

 If you omit both (1) and (2), with HEAD, you get an error on the last
 line:
 {{{
 T7082.hs:12:31:
     Couldn't match expected type `D Maybe Int' with actual type `()'
     In the second argument of `f', namely `()'
     In the expression: f (Nothing :: Maybe Int) ()
     In an equation for `x': x = f (Nothing :: Maybe Int) ()
 }}}
 but no warning.  That's because the current policy is that if there are
 any errors we report only them, and suppress all warnings.  If you omit
 the last line you get
 {{{
 T7082.hs:8:2: Warning:
     No explicit associated type or default declaration for `D'
     In the instance declaration for `R Maybe'
 }}}
 Maybe there should be a way to get warnings even if there are errors too?

 Meanwhile I'll add this as a regression test, with (1) in but (2) out.

 Simon

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



More information about the Glasgow-haskell-bugs mailing list