[GHC] #12158: ghc: panic! (the 'impossible' happened) translateConPatVec: lookup

GHC ghc-devs at haskell.org
Mon Sep 18 21:27:09 UTC 2017


#12158: ghc: panic! (the 'impossible' happened)  translateConPatVec: lookup
-------------------------------------+-------------------------------------
        Reporter:  wozgonon          |                Owner:  gkaracha
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  GHCi              |              Version:  8.0.1
      Resolution:                    |             Keywords:
                                     |  PatternMatchWarnings
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash                              |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13644            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by adamgundry):

 * related:   => #13644


Comment:

 The panic here is a duplicate of #13644. With the fix in Phab:D3988 I get:
 {{{
 Prelude> data Stock = Stock {name :: String, ric :: String, price ::
 Float}
 Prelude> price Stock{name=name,ric=ric,price=price} = price

 <interactive>:2:31: error:
     • Constructor ‘Stock’ does not have field ‘price’
     • In the pattern: Stock {name = name, ric = ric, price = price}
       In an equation for ‘price’:
           price Stock {name = name, ric = ric, price = price} = price
 Prelude> let price Stock{name=name,ric=ric,price=price} = price
 Prelude>
 }}}
 This is arguably still wrong, because if the explicit `let` binding works,
 the implicit one surely should work too. Presumably the GHCi name
 shadowing magic isn't quite consistent between the two cases.

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


More information about the ghc-tickets mailing list