summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail083.hs
blob: 7c451433f03bc38bbc10848a7e0651c597a06cec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module ShouldFail where

data Bar = Bar { flag :: Bool } deriving( Show )

data State = State { bar :: Bar, baz :: Float }

display :: State -> IO ()
display (State{ bar = Bar { flag = f, baz = b }}) = print (f,b)

-- Typo! The line above should better be:
-- display (State{ bar = Bar { flag = f }, baz = b }) = print (f,b)

-- GHC 4.04 (as released) crashed with
--      panic! (the `impossible' happened): tcLookupValue: b{-r4n-}
-- Bug reported by Sven Panne