diff options
author | Adam Gundry <adam@well-typed.com> | 2021-01-08 20:17:15 +0000 |
---|---|---|
committer | Adam Gundry <adam@well-typed.com> | 2021-01-08 20:17:15 +0000 |
commit | f381fc36491fc8a4cca05843905a1df7e9a35931 (patch) | |
tree | 341b8995693b0b91b72efaefde6d1f3a811f2ba2 | |
parent | bd877edd9499a351db947cd51ed583872b2facdf (diff) | |
download | haskell-wip/amg/T11228.tar.gz |
Add regression test for #11228wip/amg/T11228
-rw-r--r-- | testsuite/tests/overloadedrecflds/should_run/T11228.hs | 13 | ||||
-rw-r--r-- | testsuite/tests/overloadedrecflds/should_run/T11228.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/overloadedrecflds/should_run/all.T | 1 |
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, ['']) |