summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Gundry <adam@well-typed.com>2021-01-08 20:17:15 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-01-27 17:41:08 -0500
commit2f689a8bdf0bb6342794e0d8243e86e6cc4f4962 (patch)
treede2bcd2293b179619a35586a6cda273b313760b4
parente71ed07de8fff9c38fb84c72069de80963476386 (diff)
downloadhaskell-2f689a8bdf0bb6342794e0d8243e86e6cc4f4962.tar.gz
Add regression test for #11228
-rw-r--r--testsuite/tests/overloadedrecflds/should_run/T11228.hs13
-rw-r--r--testsuite/tests/overloadedrecflds/should_run/T11228.stdout1
-rw-r--r--testsuite/tests/overloadedrecflds/should_run/all.T1
3 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/overloadedrecflds/should_run/T11228.hs b/testsuite/tests/overloadedrecflds/should_run/T11228.hs
new file mode 100644
index 0000000000..6a90df5890
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_run/T11228.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE DuplicateRecordFields #-}
+{-# LANGUAGE PatternSynonyms #-}
+
+pattern MkS { x } = [x]
+pattern MkT { x, y } = (x,y)
+
+e :: ([Int], Int)
+e = MkT { x = MkS { x = 0 }, y = 1 }
+
+f t@(MkT { x = MkS { x = x }, y = y }) = t { x = x + y, y = y - x }
+f _ = undefined
+
+main = print (f e)
diff --git a/testsuite/tests/overloadedrecflds/should_run/T11228.stdout b/testsuite/tests/overloadedrecflds/should_run/T11228.stdout
new file mode 100644
index 0000000000..f750ba3510
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_run/T11228.stdout
@@ -0,0 +1 @@
+(1,1)
diff --git a/testsuite/tests/overloadedrecflds/should_run/all.T b/testsuite/tests/overloadedrecflds/should_run/all.T
index 3136beedf8..4267c10d5e 100644
--- a/testsuite/tests/overloadedrecflds/should_run/all.T
+++ b/testsuite/tests/overloadedrecflds/should_run/all.T
@@ -17,3 +17,4 @@ test('overloadedlabelsrun04', [extra_files(['OverloadedLabelsRun04_A.hs']),
test('hasfieldrun01', normal, compile_and_run, [''])
test('hasfieldrun02', normal, compile_and_run, [''])
test('T12243', normal, compile_and_run, [''])
+test('T11228', normal, compile_and_run, [''])