[GHC] #12957: In a record-update construct:ghc-stage2: panic! (the 'impossible' happened)

GHC ghc-devs at haskell.org
Sat Feb 4 15:24:55 UTC 2017


#12957: In a record-update construct:ghc-stage2: panic! (the 'impossible' happened)
-------------------------------------+-------------------------------------
        Reporter:  niteria           |                Owner:  mpickering
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:
      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:D3065,
       Wiki Page:                    |  Phab:D3064
-------------------------------------+-------------------------------------

Comment (by mpickering):

 In the original ticket, the record update gets desugared to something like

 {{{#!hs
 case emptyA of
     BFields _ -> BFields [a]
     _ -> error "Non-exhaustive patterns..."
 }}}

 GHC then warns that the first branch is inaccessible, which is true as the
 type of `emptyA` means that the value has to be either `EmptyFields` or
 `AFields`. At run-time, evaluating `f ()` causes a run-time error.

 So, is there anything here to fix apart from the panic? Usually warnings
 which affect incomplete pattern match warnings are only turned on by
 `-Wincomplete-record-updates`. This is however, a warning about
 inaccessibility/redundancy rather than incompleteness. What do you expect
 to happen niteria?

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


More information about the ghc-tickets mailing list