From 61dad5d5d807de99836c8f67412c56ae7de097e1 Mon Sep 17 00:00:00 2001
From: Michal Terepeta <michal.terepeta@gmail.com>
Date: Sun, 22 May 2011 19:40:47 +0200
Subject: [PATCH] Add a simple test for ticket #1595.

---
 tests/ghc-regress/typecheck/should_fail/T1595.hs   |   13 +++++++++++++
 .../ghc-regress/typecheck/should_fail/T1595.stderr |    6 ++++++
 tests/ghc-regress/typecheck/should_fail/all.T      |    3 ++-
 3 files changed, 21 insertions(+), 1 deletions(-)
 create mode 100644 tests/ghc-regress/typecheck/should_fail/T1595.hs
 create mode 100644 tests/ghc-regress/typecheck/should_fail/T1595.stderr

diff --git a/tests/ghc-regress/typecheck/should_fail/T1595.hs b/tests/ghc-regress/typecheck/should_fail/T1595.hs
new file mode 100644
index 0000000..fae0192
--- /dev/null
+++ b/tests/ghc-regress/typecheck/should_fail/T1595.hs
@@ -0,0 +1,13 @@
+--
+-- Check that we produce only one error message for each type
+-- signature. See ticket #1595.
+--
+
+module T1595 where
+
+foo1, bar1 :: DoesNotExist
+foo1 = undefined
+bar1 = undefined
+
+class Test a where
+  foo2, bar2 :: a -> DoesNotExist
diff --git a/tests/ghc-regress/typecheck/should_fail/T1595.stderr b/tests/ghc-regress/typecheck/should_fail/T1595.stderr
new file mode 100644
index 0000000..d3f665c
--- /dev/null
+++ b/tests/ghc-regress/typecheck/should_fail/T1595.stderr
@@ -0,0 +1,6 @@
+
+T1595.hs:8:15:
+    Not in scope: type constructor or class `DoesNotExist'
+
+T1595.hs:13:22:
+    Not in scope: type constructor or class `DoesNotExist'
diff --git a/tests/ghc-regress/typecheck/should_fail/all.T b/tests/ghc-regress/typecheck/should_fail/all.T
index 7e78d24..c2e7026 100644
--- a/tests/ghc-regress/typecheck/should_fail/all.T
+++ b/tests/ghc-regress/typecheck/should_fail/all.T
@@ -199,6 +199,7 @@ test('tcfail203a', normal, compile_fail, [''])
 test('tcfail204', normal, compile_fail, [''])
 test('tcfail206', normal, compile_fail, [''])
 
+test('T1595', normal, compile_fail, [''])
 test('T1899', normal, compile_fail, [''])
 test('T2126', normal, compile_fail, [''])
 test('T2307', normal, compile_fail, [''])
@@ -239,4 +240,4 @@ test('T5084', normal, compile_fail, [''])
 test('tcfail208', normal, compile_fail, [''])
 
 test('FailDueToGivenOverlapping', normal, compile_fail, [''])
-test('LongWayOverlapping', normal, compile_fail, [''])
\ No newline at end of file
+test('LongWayOverlapping', normal, compile_fail, [''])
-- 
1.7.5.rc3

