[GHC] #14270: GHC HEAD's ghc-stage1 panics on Data.Typeable.Internal

GHC ghc-devs at haskell.org
Wed Oct 11 13:09:31 UTC 2017


#14270: GHC HEAD's ghc-stage1 panics on Data.Typeable.Internal
-------------------------------------+-------------------------------------
        Reporter:  hvr               |                Owner:  bgamari
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.4.1
       Component:  Compiler          |              Version:  8.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:  #14236            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Crumbs.  comment:15 exposes a completely new bug in float-out.  I have a
 fix validating.  The relevant Note is
 {{{
 {- Note [Floating and kind casts]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Consider this
    case x of
      K (co :: * ~# k) -> let v :: Int |> co
                              v = e
                          in blah

 Then, even if we are abstracting over Ids, or if e is bottom, we can't
 float v outside the 'co' binding.  Reason: if we did we'd get
     v' :: forall k. (Int ~# Age) => Int |> co
 and now 'co' isn't in scope in that type. The underlying reason is
 that 'co' is a value-level thing and we can't abstract over that in
 a type.  So if v's /type/ mentions 'co' we can't float it out beyond
 the binding site of 'co'.

 That's why we have this as_far_as_poss stuff.  Usually as_far_as_poss
 is just tOP_LEVEL; but occasionally a coercion variable (which is an
 Id) mentioned in type prevents this.

 Example Trac #14270 comment:15.
 }}}
 However this is ''not'' the original bug for this ticket.

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


More information about the ghc-tickets mailing list