diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-07-18 11:47:52 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-07-25 09:42:01 -0400 |
commit | e31ead39331f1bb6d3976ae7573be8fe2b364172 (patch) | |
tree | 1c36028ced82d2f7f6566003416de76b3be6cdce /testsuite | |
parent | dc27e15a76486b1ebd27a77f8515044c2671e22d (diff) | |
download | haskell-e31ead39331f1bb6d3976ae7573be8fe2b364172.tar.gz |
Add tests that -XHaskell98 and -XHaskell2010 enable DeepSubsumption
Diffstat (limited to 'testsuite')
3 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/DeepSubsumption06.hs b/testsuite/tests/typecheck/should_compile/DeepSubsumption06.hs new file mode 100644 index 0000000000..6e8b64c2c2 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/DeepSubsumption06.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE NoPolyKinds #-} +{-# LANGUAGE RankNTypes #-} +module DeepSubsumption06 where + +class Profunctor p where + dimap :: (s -> a) -> (b -> t) -> p i a b -> p i s t + +type Iso s t a b = forall p i . Profunctor p => p i a b -> p i s t + +iso :: (s -> a) -> (b -> t) -> Iso s t a b +-- iso f g = dimap f g +iso = dimap diff --git a/testsuite/tests/typecheck/should_compile/DeepSubsumption07.hs b/testsuite/tests/typecheck/should_compile/DeepSubsumption07.hs new file mode 100644 index 0000000000..1c70025051 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/DeepSubsumption07.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE NoPolyKinds #-} +{-# LANGUAGE RankNTypes #-} +module DeepSubsumption07 where + +class Profunctor p where + dimap :: (s -> a) -> (b -> t) -> p i a b -> p i s t + +type Iso s t a b = forall p i . Profunctor p => p i a b -> p i s t + +iso :: (s -> a) -> (b -> t) -> Iso s t a b +-- iso f g = dimap f g +iso = dimap diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 3410ad68bb..3071562989 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -849,3 +849,5 @@ test('DeepSubsumption02', normal, compile, ['']) test('DeepSubsumption03', normal, compile, ['']) test('DeepSubsumption04', normal, compile, ['']) test('DeepSubsumption05', normal, compile, ['']) +test('DeepSubsumption06', normal, compile, ['-XHaskell98']) +test('DeepSubsumption07', normal, compile, ['-XHaskell2010']) |