[GHC] #12130: ghc: panic! (the 'impossible' happened): find_tycon Block []

GHC ghc-devs at haskell.org
Sat Jun 4 18:37:43 UTC 2016


#12130: ghc: panic! (the 'impossible' happened): find_tycon Block []
-------------------------------------+-------------------------------------
        Reporter:  jeiea             |                Owner:
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:
       Component:  Template Haskell  |              Version:  8.0.1
      Resolution:                    |             Keywords:
                                     |  DisambiguateRecordFields
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash                              |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #11228            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by thomie):

 * priority:  normal => high
 * cc: adamgundry (added)
 * related:   => #11228
 * keywords:   => DisambiguateRecordFields


Comment:

 Regression from 7.10. Here is a reproducer:

 A.hs:
 {{{#!hs
 {-# Language TemplateHaskell #-}
 {-# Language DisambiguateRecordFields #-}
 -- DisambiguateRecordFields (or RecordWildCards) is necessary
 -- to trigger the bug.

 module A where

 import B hiding (Block)  -- Hiding "Block" is necessary to trigger the
 bug.

 b = $(block)

 {-
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.0.1 for x86_64-unknown-linux):
         find_tycon
   Block
   []
 -}
 }}}

 B.hs:
 {{{#!hs
 {-# LANGUAGE TemplateHaskell #-}

 module B where

 import Language.Haskell.TH

 data Block = Block
     { blockSelector :: ()
     }

 block :: Q Exp
 block =
     [| Block {
          -- Using record syntax is neccesary to trigger the bug.
          blockSelector = ()
        }
     |]
 }}}

 CC adamgundry, as he was the last to touch `find_tycon`.

 The discussion in ticket:11228#comment:4 seems relevant.

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


More information about the ghc-tickets mailing list