diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/simplCore/should_compile/T20200b.hs | 11 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_compile/T20200b.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_compile/all.T | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T20200b.hs b/testsuite/tests/simplCore/should_compile/T20200b.hs new file mode 100644 index 0000000000..8826e66db5 --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T20200b.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE GADTs #-} +{-# LANGUAGE DataKinds #-} +module T20200b where + +import Data.Kind + +xrecTuple :: Rec [Bool, Char] -> (Bool, Char) +xrecTuple (a :& (b :& _)) = (a, b) + +data Rec :: [Type] -> Type where + (:&) :: r -> !(Rec rs) -> Rec (r ': rs) diff --git a/testsuite/tests/simplCore/should_compile/T20200b.stderr b/testsuite/tests/simplCore/should_compile/T20200b.stderr new file mode 100644 index 0000000000..1db18a40f6 --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T20200b.stderr @@ -0,0 +1,4 @@ + +T20200b.hs:8:1: warning: [-Woverlapping-patterns (in -Wdefault)] + Pattern match has inaccessible right hand side + In an equation for ‘xrecTuple’: xrecTuple (a :& (b :& _)) = ... diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index 03039e8f8c..7db92e561c 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -374,3 +374,4 @@ test('T16373', normal, compile, ['']) test('T20112', normal, multimod_compile, ['T20112', '-O -v0 -g1']) test('T20200', normal, compile, ['']) test('T20200a', normal, compile, ['-O2']) +test('T20200b', normal, compile, ['-O2']) |