diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2017-10-05 15:46:05 -0400 |
---|---|---|
committer | Ryan Scott <ryan.gl.scott@gmail.com> | 2017-10-05 15:46:11 -0400 |
commit | 429fafb5b2b1ac02fd04d9a98e30b5991125692c (patch) | |
tree | cd64b98344e0d706d6b931f2570774516ad8ba2e /testsuite/tests/patsyn | |
parent | d8d87fa2b22404b7939956974f53858c41ec7769 (diff) | |
download | haskell-429fafb5b2b1ac02fd04d9a98e30b5991125692c.tar.gz |
Add regression test for #14326
Commit 6b77914cd37b697354611bcd87897885c1e5b4a6 wound up
fixing #14326. Let's add a regression test so that it stays
that way.
Diffstat (limited to 'testsuite/tests/patsyn')
-rw-r--r-- | testsuite/tests/patsyn/should_compile/T14326.hs | 21 | ||||
-rw-r--r-- | testsuite/tests/patsyn/should_compile/all.T | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/patsyn/should_compile/T14326.hs b/testsuite/tests/patsyn/should_compile/T14326.hs new file mode 100644 index 0000000000..59a1eb46fa --- /dev/null +++ b/testsuite/tests/patsyn/should_compile/T14326.hs @@ -0,0 +1,21 @@ +{-# LANGUAGE PatternSynonyms #-} +{-# LANGUAGE ExplicitForAll #-} +{-# OPTIONS_GHC -fwarn-incomplete-patterns #-} +module T14326 where + +data E a b = L' a | R b +pattern L :: forall b a. a -> E a b +pattern L a = L' a +{-# COMPLETE L, R #-} + +testMono :: E (E Int Int) Int -> Int +testMono x = case x of + L (L _) -> 0 + L (R _) -> 1 + R _ -> 2 + +testPoly :: E (E a b) c -> Int +testPoly x = case x of + L (L _) -> 0 + L (R _) -> 1 + R _ -> 2 diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T index b8c9806694..8bc9dbdcd9 100644 --- a/testsuite/tests/patsyn/should_compile/all.T +++ b/testsuite/tests/patsyn/should_compile/all.T @@ -73,3 +73,4 @@ test('T13752a', normal, compile, ['']) test('T13768', normal, compile, ['']) test('T14058', [extra_files(['T14058.hs', 'T14058a.hs'])], multimod_compile, ['T14058', '-v0']) +test('T14326', normal, compile, ['']) |