From 31fd59cc27186dce8174409dd0511951cbf28e9a Mon Sep 17 00:00:00 2001
From: simonpj <unknown>
Date: Fri, 20 Aug 1999 11:32:41 +0000
Subject: [PATCH] [project @ 1999-08-20 11:32:41 by simonpj] Add tcfail083

---
 ghc/tests/typecheck/should_fail/tcfail083.hs     | 16 ++++++++++++++++
 ghc/tests/typecheck/should_fail/tcfail083.stderr | 10 ++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 ghc/tests/typecheck/should_fail/tcfail083.hs
 create mode 100644 ghc/tests/typecheck/should_fail/tcfail083.stderr

diff --git a/ghc/tests/typecheck/should_fail/tcfail083.hs b/ghc/tests/typecheck/should_fail/tcfail083.hs
new file mode 100644
index 000000000000..a79be4e7ac97
--- /dev/null
+++ b/ghc/tests/typecheck/should_fail/tcfail083.hs
@@ -0,0 +1,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
+
diff --git a/ghc/tests/typecheck/should_fail/tcfail083.stderr b/ghc/tests/typecheck/should_fail/tcfail083.stderr
new file mode 100644
index 000000000000..fc7776bcb0a6
--- /dev/null
+++ b/ghc/tests/typecheck/should_fail/tcfail083.stderr
@@ -0,0 +1,10 @@
+
+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
+
-- 
GitLab