Simon Jakobi pushed to branch wip/sjakobi/regression-tests-2 at Glasgow Haskell Compiler / GHC Commits: f917ac96 by Simon Jakobi at 2026-03-04T23:34:01+01:00 Add regression test for #15588 Closes #15588. - - - - - 3 changed files: - + testsuite/tests/dependent/should_fail/T15588.hs - + testsuite/tests/dependent/should_fail/T15588.stderr - testsuite/tests/dependent/should_fail/all.T Changes: ===================================== testsuite/tests/dependent/should_fail/T15588.hs ===================================== @@ -0,0 +1,25 @@ +{- This program used to cause a panic (#15588), but it should possibly even be +accepted. See #15589. -} +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} +module T15588 where + +import Data.Proxy +import Data.Type.Equality +import Data.Type.Bool +import Data.Kind + +data SameKind :: forall k. k -> k -> Type +type family IfK (e :: Proxy (j :: Bool)) (f :: m) (g :: n) :: If j m n where + IfK (_ :: Proxy True) f _ = f + IfK (_ :: Proxy False) _ g = g + +y :: forall ck (c :: ck). ck :~: Proxy True -> () +y Refl = let x :: forall a b (d :: a). SameKind (IfK c b d) d + x = undefined + in () + ===================================== testsuite/tests/dependent/should_fail/T15588.stderr ===================================== @@ -0,0 +1,7 @@ +T15588.hs:18:9: error: [GHC-25897] + • Couldn't match kind ‘j’ with ‘True’ + Expected kind ‘Proxy j’, + but ‘_ :: Proxy True’ has kind ‘Proxy True’ + • In the first argument of ‘IfK’, namely ‘(_ :: Proxy True)’ + In the type family declaration for ‘IfK’ + ===================================== testsuite/tests/dependent/should_fail/all.T ===================================== @@ -34,6 +34,7 @@ test('T15215', normal, compile_fail, ['']) test('T15308', normal, compile_fail, ['-fno-print-explicit-kinds']) test('T15343', normal, compile_fail, ['']) test('T15380', normal, compile_fail, ['']) +test('T15588', normal, compile_fail, ['']) test('T15591b', normal, compile_fail, ['']) test('T15591c', normal, compile_fail, ['']) test('T15743c', normal, compile_fail, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f917ac96e733d77113768f00b044a65b... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f917ac96e733d77113768f00b044a65b... You're receiving this email because of your account on gitlab.haskell.org.