From 84eaa26fda63abb2681215a42c152e770ea552ca Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Tue, 26 Oct 2021 15:36:47 +0300 Subject: Add test for #20562 --- testsuite/tests/module/T20562.hs | 15 +++++++++++++++ testsuite/tests/module/all.T | 1 + 2 files changed, 16 insertions(+) create mode 100644 testsuite/tests/module/T20562.hs diff --git a/testsuite/tests/module/T20562.hs b/testsuite/tests/module/T20562.hs new file mode 100644 index 0000000000..352be5e9e2 --- /dev/null +++ b/testsuite/tests/module/T20562.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE PatternSynonyms #-} +module Main (main) where + +import GHC.Tuple + +type OneTuple = Solo + +only :: OneTuple a -> a +only = getSolo + +pattern OneTuple :: a -> Solo a +pattern OneTuple a = Solo a + +main :: IO () +main = print (only (OneTuple 'x')) diff --git a/testsuite/tests/module/all.T b/testsuite/tests/module/all.T index 4a2aacc26f..212d9ecbb7 100644 --- a/testsuite/tests/module/all.T +++ b/testsuite/tests/module/all.T @@ -292,3 +292,4 @@ test('T13528', normal, compile, ['']) test('T13622', normal, compile, ['']) test('T13704a', normal, compile, ['-main-is Main.program']) test('T13704b', [], multimod_compile, ['T13704b1.hs T13704b2.hs', '-main-is T13704b2.program -v0']) +test('T20562', normal, compile, ['']) -- cgit v1.2.1