diff options
author | Simon Peyton Jones <simon.peytonjones@gmail.com> | 2023-02-28 22:43:50 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-03-02 22:45:11 -0500 |
commit | 2f97c86151d7eed115ddcbdee1842684aed63176 (patch) | |
tree | 1eceae2a0e467c0ea8564c8200bef1daae8255d0 /testsuite | |
parent | 68dd64ffa6f164dce4ac010b9f5e1adfefeae7c7 (diff) | |
download | haskell-2f97c86151d7eed115ddcbdee1842684aed63176.tar.gz |
Get the right in-scope set in etaBodyForJoinPoint
Fixes #23026
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/simplCore/should_compile/T23026.hs | 28 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_compile/all.T | 1 |
2 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T23026.hs b/testsuite/tests/simplCore/should_compile/T23026.hs new file mode 100644 index 0000000000..4ca2a82550 --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T23026.hs @@ -0,0 +1,28 @@ +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE RankNTypes #-} + +module T23026 where + +import Data.Kind (Type) + +data Sing (a :: k) +data SingInstance (a :: k) = SingInstance (Sing a) + +app :: (Sing a -> SingInstance a) -> Sing a -> SingInstance a +app f x = f x +{-# NOINLINE app #-} + +withSomeSing + :: forall k2 k1 (f :: k2 -> k1 -> Type) a2 a1. + (Sing a2, Sing a1) + -> f a2 a1 + -> (forall b2 b1. f b2 b1 -> Int) + -> Int +withSomeSing (sa2, sa1) x g = + case app SingInstance sa2 of + SingInstance _ -> + case app SingInstance sa1 of + SingInstance _ -> g x +{-# INLINABLE withSomeSing #-} diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index c4e78e0f75..bf7f4e58dd 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -476,3 +476,4 @@ test('T23012', normal, compile, ['-O']) test('RewriteHigherOrderPatterns', normal, compile, ['-O -ddump-rule-rewrites -dsuppress-all -dsuppress-uniques']) test('T23024', normal, multimod_compile, ['T23024', '-O -v0']) +test('T23026', normal, compile, ['-O']) |