summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-02-21 17:44:02 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2017-02-21 17:44:02 +0000
commit499a15db0d71a9d0b91cbd5f509dabff50df2566 (patch)
tree398485c05104248e644487ac3eb05a3565334500 /testsuite/tests
parent3c62b1d6b672e7727ea5fa56c69bf43e43d0fd8f (diff)
downloadhaskell-499a15db0d71a9d0b91cbd5f509dabff50df2566.tar.gz
Test Trac #13300
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/typecheck/should_fail/T13300.hs10
-rw-r--r--testsuite/tests/typecheck/should_fail/T13300.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T1
3 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T13300.hs b/testsuite/tests/typecheck/should_fail/T13300.hs
new file mode 100644
index 0000000000..2803b4292b
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T13300.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE GADTs #-}
+module T13300 where
+
+data W where
+ WI :: Int
+ WD :: Double
+
+data Superblock
+ = A { f :: W }
+ | B { f :: W }
diff --git a/testsuite/tests/typecheck/should_fail/T13300.stderr b/testsuite/tests/typecheck/should_fail/T13300.stderr
new file mode 100644
index 0000000000..5bc8e4d3e3
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T13300.stderr
@@ -0,0 +1,6 @@
+
+T13300.hs:5:3: error:
+ • Data constructor ‘WI’ returns type ‘Int’
+ instead of an instance of its parent type ‘W’
+ • In the definition of data constructor ‘WI’
+ In the data type declaration for ‘W’
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index e9cad8f9d5..a9c5f80dfc 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -426,3 +426,4 @@ test('StrictBinds', normal, compile_fail, [''])
test('T13105', normal, compile_fail, [''])
test('LevPolyBounded', normal, compile_fail, [''])
test('T13292', normal, multimod_compile, ['T13292', '-v0 -fdefer-type-errors'])
+test('T13300', normal, compile_fail, [''])