diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2019-05-29 13:29:21 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-09-19 09:03:19 -0400 |
commit | c3eaaca63c81b3164e35b65d7b508bf2e8cb5fc6 (patch) | |
tree | 3290186f3ca97756db4ced593143c5ecc60e131b /testsuite/tests | |
parent | c77fc3b20e93ba3215791d8d087a096853c4dd67 (diff) | |
download | haskell-c3eaaca63c81b3164e35b65d7b508bf2e8cb5fc6.tar.gz |
Add a missing update of sc_hole_ty (#16312)
In simplCast I totally failed to keep the sc_hole_ty field of
ApplyToTy (see Note [The hole type in ApplyToTy]) up to date.
When a cast goes by, of course the hole type changes.
Amazingly this has not bitten us before, but #16312 finally
triggered it. Fortunately the fix is simple.
Fixes #16312.
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T16312.hs | 14 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T16312.hs b/testsuite/tests/typecheck/should_compile/T16312.hs new file mode 100644 index 0000000000..1823d98558 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T16312.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE GADTs #-} +{-# LANGUAGE RankNTypes #-} +module T16312 where + +newtype Curried g h a = + Curried { runCurried :: forall r. g (a -> r) -> h r } + +instance Functor g => Functor (Curried g h) where + fmap f (Curried g) = Curried (g . fmap (.f)) + +instance (Functor g, g ~ h) => Applicative (Curried g h) where + pure a = Curried (fmap ($a)) + Curried mf <*> Curried ma = Curried (ma . mf . fmap (.)) + {-# INLINE (<*>) #-} diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 9a91f4ea9c..bb01a02dd3 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -671,6 +671,7 @@ test('T16204a', normal, compile, ['']) test('T16204b', normal, compile, ['']) test('T16225', normal, compile, ['']) test('T13951', normal, compile, ['']) +test('T16312', normal, compile, ['-O']) test('T16411', normal, compile, ['']) test('T16609', normal, compile, ['']) test('T16827', normal, compile, ['']) |