Commit 31fd59cc authored by simonpj's avatar simonpj
Browse files

[project @ 1999-08-20 11:32:41 by simonpj]

Add tcfail083
parent c3135896
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
tcfail083.hs:8:
Constructor `Bar' does not have field `baz'
In the pattern: Bar {flag = f, baz = b}
In the pattern: State {bar = Bar {flag = f, baz = b}}
In an equation for function `display':
display (State {bar = Bar {flag = f, baz = b}}) = print (f, b)
Compilation had errors
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment