[GHC] #16312: Optimization + adding an INLINE pragma triggers Core Lint error (Type of case alternatives not the same as the annotation on case)

GHC ghc-devs at haskell.org
Mon Feb 18 11:02:00 UTC 2019


#16312: Optimization + adding an INLINE pragma triggers Core Lint error (Type of
case alternatives not the same as the annotation on case)
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Definite bug here!  I investigated a bit. Here's a simpler example that
 crashes in the same way.
 {{{
 {-# LANGUAGE GADTs #-}
 {-# LANGUAGE RankNTypes, KindSignatures #-}
 module Bug where
 import GHC.Base

 data Curried (g :: * -> *) (h :: * -> *) a

 instance Functor (Curried g h) where
   fmap = error "urk2"

 instance (g ~ h) => Applicative (Curried g h) where
   pure   = error "urk"
   liftA2 = error "urk"
   (<*)   = error "urk"
   (*>)   = error "urk"

   (<*>) = grstargr

 wib :: (g ~ h) => Curried g h (b->b) -> Curried g h b -> Curried g h b
 wib a1 a2 =  a1 <*> a2

 grstargr :: Curried g h (a->b) -> Curried g h a -> Curried g h b
 {-# NOINLINE grstargr #-}
 grstargr = error "urk"
 }}}
 I'm pretty sure that the wrong-ness is that the result type attached to a
 `Case` in Core is getting out of date.  I don't yet know how though.

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


More information about the ghc-tickets mailing list