[GHC] #7748: Runtime <<loop>> due to incorrect inferred type

GHC cvs-ghc at haskell.org
Thu Mar 7 12:58:30 CET 2013


#7748: Runtime <<loop>> due to incorrect inferred type
----------------------------------------+-----------------------------------
Reporter:  jbransen                     |          Owner:                         
    Type:  bug                          |         Status:  new                    
Priority:  normal                       |      Component:  Compiler (Type checker)
 Version:  7.6.2                        |       Keywords:                         
      Os:  Unknown/Multiple             |   Architecture:  Unknown/Multiple       
 Failure:  GHC accepts invalid program  |      Blockedby:                         
Blocking:                               |        Related:                         
----------------------------------------+-----------------------------------

Comment(by dreixel):

 The "incorrect type" is rejected by GHC HEAD with the error message:
 {{{
     Couldn't match expected type ‛a’
                 with actual type ‛Maybe (Maybe (r -> ()))’
       ‛a’ is a rigid type variable bound by
           the type signature for test :: a -> r -> () at Test.hs:7:9
     Relevant bindings include
       test :: a -> r -> () (bound at Test.hs:8:1)
       zd :: a (bound at Test.hs:8:6)
       f :: r -> () (bound at Test.hs:9:8)
       g :: r -> () (bound at Test.hs:9:16)
     In the pattern: Nothing
     In a case alternative: Nothing -> const ()
     In the expression:
       case zd of {
         Nothing -> const ()
         Just Nothing -> const ()
         Just (Just p) -> p }
 }}}

 The "correct type" is accepted, and the program runs and terminates. It is
 also the type inferred by HEAD.

 So, it seems like whatever it was, it has been fixed.

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



More information about the ghc-tickets mailing list