[GHC] #14777: panic when using a function defined in terms of `error`

GHC ghc-devs at haskell.org
Mon Mar 12 07:45:36 UTC 2018


#14777: panic when using a function defined in terms of `error`
-------------------------------------+-------------------------------------
        Reporter:  zilinc            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.2
      Resolution:                    |             Keywords:
Operating System:  Linux             |         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 dfeuer):

 I took a peek at monoidal's reproduction, using a devel2 build of 8.2.2
 with some extra `HasCallStack`s. Running with Core Lint and `-O2`, I get

 {{{
 [2 of 2] Compiling Cogent.Desugar   ( Cogent/Desugar.hs, Cogent/Desugar.o
 )
 WARNING: file compiler/simplCore/OccurAnal.hs, line 69
   Glomming in Cogent.Desugar: [s55P :-> OnceL!]
 ghc-stage2: panic! (the 'impossible' happened)
   (GHC version 8.2.2 for x86_64-unknown-linux):
         idInfo
   v_X5mQ
   Call stack:
       CallStack (from HasCallStack):
         prettyCurrentCallStack, called at
 compiler/utils/Outputable.hs:1133:58 in ghc:Outputable
         callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in
 ghc:Outputable
         pprPanic, called at compiler/basicTypes/Var.hs:526:34 in ghc:Var
         idInfo, called at compiler/basicTypes/Id.hs:736:37 in ghc:Id
         idInlinePragma, called at compiler/basicTypes/Id.hs:745:49 in
 ghc:Id
         idInlineActivation, called at
 compiler/simplCore/SimplUtils.hs:923:56 in ghc:SimplUtils
         getUnfoldingInRuleMatch, called at
 compiler/simplCore/Simplify.hs:1946:34 in ghc:Simplify
         tryRules, called at compiler/simplCore/Simplify.hs:1776:22 in
 ghc:Simplify
 }}}

 (I have no idea if the lint warning is relevant). About all I can see
 about what's gone wrong is that something seems to be treating a type
 variable as though it were a term variable. That is, if I understand the
 `Var` type properly.

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


More information about the ghc-tickets mailing list