Test Trac #13300
authorSimon Peyton Jones <simonpj@microsoft.com>
Tue, 21 Feb 2017 17:44:02 +0000 (17:44 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Tue, 21 Feb 2017 17:44:02 +0000 (17:44 +0000)
testsuite/tests/typecheck/should_fail/T13300.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T13300.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T

diff --git a/testsuite/tests/typecheck/should_fail/T13300.hs b/testsuite/tests/typecheck/should_fail/T13300.hs
new file mode 100644 (file)
index 0000000..2803b42
--- /dev/null
@@ -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 (file)
index 0000000..5bc8e4d
--- /dev/null
@@ -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’
index e9cad8f..a9c5f80 100644 (file)
@@ -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, [''])