[GHC] #12007: Panic when loading file with nested pattern synonyms into ghci

GHC ghc-devs at haskell.org
Wed May 25 16:05:30 UTC 2016


#12007: Panic when loading file with nested pattern synonyms into ghci
-------------------------------------+-------------------------------------
        Reporter:  MikeIzbicki       |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
                                     |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 I wanted a break from dissertation-writing so I took a look.

 The problem is surely in the byte-code generator, which is opaque to me.
 The nub of the problem seems to be here:

 {{{#!hs
 -- introduce a let binding for a ticked case expression. This rule
 -- *should* only fire when the expression was not already let-bound
 -- (the code gen for let bindings should take care of that).  Todo: we
 -- call exprFreeVars on a deAnnotated expression, this may not be the
 -- best way to calculate the free vars but it seemed like the least
 -- intrusive thing to do
 schemeE d s p exp@(AnnTick (Breakpoint _id _fvs) _rhs)
    = if isUnliftedType ty
         then do ...
         else do
           id <- newId ty
           ...
    where exp' = deAnnotate' exp
          ty   = exprType exp'
 }}}

 The problem is that `ty :: TYPE rep` for a skolem `rep`. So we've created
 an abomination: a runtime variable (the `id`) whose type is representation
 polymorphic. Indeed, even the `isUnliftedType` query is bogus, because
 there is no way to know whether or not `ty` is unlifted at this point.

 How we've gotten here or what this code is doing, I don't know. But this
 is definitely the source of the problem! I'm afraid I won't have a chance
 to dig deeper here, but hopefully these bread crumbs can be picked up by
 the next traveler.

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


More information about the ghc-tickets mailing list