[GHC] #15523: GHC Panic on malformed newtype and StrictData

GHC ghc-devs at haskell.org
Wed Aug 15 09:39:44 UTC 2018


#15523: GHC Panic on malformed newtype and StrictData
-------------------------------------+-------------------------------------
        Reporter:  rdnetto           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.4.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D5070
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by monoidal):

 * differential:   => Phab:D5070


Comment:

 Fortunately, the bug is not present in master. I put a regression test on
 Phab.

 {{{
 $ ghc -O T15523
 [1 of 1] Compiling Main             ( T15523.hs, T15523.o )
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.4.3 for x86_64-unknown-linux):
         mkNewTyConRhs
   Foo []
   Call stack:
       CallStack (from HasCallStack):
         callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in
 ghc:Outputable
         pprPanic, called at compiler/iface/BuildTyCl.hs:77:27 in
 ghc:BuildTyCl

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

 $ head/inplace/bin/ghc-stage2 T15523
 [1 of 1] Compiling Main             ( T15523.hs, T15523.o )

 T15523.hs:5:20: error:
     • The constructor of a newtype must have exactly one field
         but ‘Foo’ has none
     • In the definition of data constructor ‘Foo’
       In the newtype declaration for ‘Duration’
   |
 5 | newtype Duration = Foo
   |                    ^^^
 }}}

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


More information about the ghc-tickets mailing list