[GHC] #12158: ghc: panic! (the 'impossible' happened) translateConPatVec: lookup
GHC
ghc-devs at haskell.org
Mon Jun 6 15:18:18 UTC 2016
#12158: ghc: panic! (the 'impossible' happened) translateConPatVec: lookup
-------------------------------------+-------------------------------------
Reporter: wozgonon | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Windows | Architecture: x86_64
Type of failure: Compile-time | (amd64)
crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by wozgonon):
-- 1) Place code at the end of this comment into a source file: test.hs
-- 2) In WinCHCI
-- Prelude> :load test.hs
-- *Main> price Stock{name=name,ric=ric,price=price} = price
-- 3) Observe error message:
-- ghc: panic! (the 'impossible' happened)
-- (GHC version 8.0.1 for x86_64-unknown-mingw32):
-- translateConPatVec: lookup
--
-- Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
--test.hs
data Stock = Stock {name :: String, ric :: String, price :: Float}
deriving (Show)
arm = Stock {name="ARM Holdings", ric="ARM.L", price=999}
iii = Stock {name="3I Group PLC", ric="III.L", price=549}
stockprice(Stock{name=name,ric=ric,price=price})=price
type Holding = (Stock,Int)
stock h= fst h
shares h= snd h
value h=stockprice(stock h)*fromIntegral(shares(h))
type Portfolio = [Holding]
portfolio= [(arm, 198), (iii, 0)]
list= map value portfolio
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12158#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list