[GHC] #8570: In a pattern binding:ghc: panic! (the 'impossible' happened): Bogus selector Id

GHC ghc-devs at haskell.org
Thu Nov 28 17:40:38 UTC 2013


#8570: In a pattern binding:ghc: panic! (the 'impossible' happened): Bogus
selector Id
---------------------------------------+----------------------------------
        Reporter:  rzetterberg         |            Owner:
            Type:  bug                 |           Status:  new
        Priority:  normal              |        Milestone:
       Component:  Compiler            |          Version:  7.6.3
      Resolution:                      |         Keywords:
Operating System:  Linux               |     Architecture:  x86_64 (amd64)
 Type of failure:  Compile-time crash  |       Difficulty:  Unknown
       Test Case:                      |       Blocked By:
        Blocking:                      |  Related Tickets:
---------------------------------------+----------------------------------

Comment (by parcs):

 This code reproduces the error:

 {{{
 #!haskell
 module A where

 import B (Image(filepath), logo)
 import C (Field(Image))

 foo = let Image {filepath = ()} = logo in ()
 }}}

 {{{
 module B where

 data Image = Image { filepath :: () }

 logo = Image ()
 }}}

 {{{
 module C where

 data Field = Image
 }}}

 {{{
 $ ghc-stage2 A
 [1 of 3] Compiling C                ( C.hs, C.o )
 [2 of 3] Compiling B                ( B.hs, B.o )
 [3 of 3] Compiling A                ( A.hs, A.o )

 A.hs:6:18:
     Constructor ‛Image’ does not have field ‛filepath’
     In the pattern: Image {filepath = ()}
     In a pattern binding: Image {filepath = ()} = logo
     In the expression: let Image {filepath = ()} = logo in ()

 A.hs:6:35:
     Couldn't match expected type ‛Field’ with actual type ‛Image’
     In the expression: logo
     In a pattern binding:ghc-stage2: panic! (the 'impossible' happened)
   (GHC version 7.7.20131127 for x86_64-unknown-linux):
         Bogus selector Id

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

 One-shot mode behaves similarly.

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


More information about the ghc-tickets mailing list