diff options
-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, ['']) |