summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/pmcheck/should_compile/T12957a.hs25
-rw-r--r--testsuite/tests/pmcheck/should_compile/all.T1
2 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/pmcheck/should_compile/T12957a.hs b/testsuite/tests/pmcheck/should_compile/T12957a.hs
new file mode 100644
index 0000000000..72330e98e0
--- /dev/null
+++ b/testsuite/tests/pmcheck/should_compile/T12957a.hs
@@ -0,0 +1,25 @@
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE KindSignatures #-}
+
+-- The original test case for Trac #12957
+
+module T12957a where
+
+data T = A | B
+
+data Fields (t :: T) where
+ BFields :: { list :: [()] } -> Fields 'B
+
+ AFields :: Fields 'A
+
+ EmptyFields :: Fields t
+
+emptyA :: Fields 'A
+emptyA = AFields
+
+data S t = S { sFields :: Fields t }
+
+f :: () -> S 'A
+f a = (S EmptyFields) { sFields = emptyA { list = [ a ] } }
diff --git a/testsuite/tests/pmcheck/should_compile/all.T b/testsuite/tests/pmcheck/should_compile/all.T
index 7fc4fc5310..874535807d 100644
--- a/testsuite/tests/pmcheck/should_compile/all.T
+++ b/testsuite/tests/pmcheck/should_compile/all.T
@@ -60,6 +60,7 @@ test('pmc007', [], compile,
test('T11245', [], compile,
['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T12957', [], compile, ['-fwarn-overlapping-patterns'])
+test('T12957a', [], compile, ['-fwarn-overlapping-patterns'])
# EmptyCase
test('T10746', [], compile,