[Git][ghc/ghc][master] Add regression test for #24867
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 30341168 by Simon Peyton Jones at 2026-01-08T13:31:38-05:00 Add regression test for #24867 - - - - - 3 changed files: - + testsuite/tests/pmcheck/should_compile/T24867.hs - + testsuite/tests/pmcheck/should_compile/T24867.stderr - testsuite/tests/pmcheck/should_compile/all.T Changes: ===================================== testsuite/tests/pmcheck/should_compile/T24867.hs ===================================== @@ -0,0 +1,17 @@ +{-# LANGUAGE DataKinds, TypeFamilies, GADTs #-} +{-# OPTIONS_GHC -Winaccessible-code -Werror #-} + +module T24867 where + +data T = Z | S + +data ST n where + SS :: ST S + +type family F n where + F Z = Z + F S = Z + +-- Should be rejected with inaccessible RHS +f :: F m ~ n => ST m -> ST n -> () +f _ SS = () ===================================== testsuite/tests/pmcheck/should_compile/T24867.stderr ===================================== @@ -0,0 +1,4 @@ +T24867.hs:17:1: error: [GHC-94210] [-Woverlapping-patterns (in -Wdefault), Werror=overlapping-patterns] + Pattern match has inaccessible right hand side + In an equation for ‘f’: f _ SS = ... + ===================================== testsuite/tests/pmcheck/should_compile/all.T ===================================== @@ -181,3 +181,4 @@ test('T25257', normal, compile, [overlapping_incomplete]) test('T24845', [], compile, [overlapping_incomplete]) test('T22652', [], compile, [overlapping_incomplete]) test('T22652a', [], compile, [overlapping_incomplete]) +test('T24867', [], compile_fail, [overlapping_incomplete]) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3034116893813e8835f0e8ba671e4c1e... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3034116893813e8835f0e8ba671e4c1e... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)