Simon Jakobi pushed to branch wip/sjakobi/regression-tests-3 at Glasgow Haskell Compiler / GHC
Commits:
-
b3d5bc61
by Simon Jakobi at 2026-03-06T14:32:49+01:00
3 changed files:
- + testsuite/tests/typecheck/should_compile/T11141.hs
- + testsuite/tests/typecheck/should_compile/T11141.stderr
- testsuite/tests/typecheck/should_compile/all.T
Changes:
| 1 | +{-# LANGUAGE FunctionalDependencies #-}
|
|
| 2 | +{-# LANGUAGE InstanceSigs #-}
|
|
| 3 | +{-# LANGUAGE ScopedTypeVariables #-}
|
|
| 4 | +module T11141 where
|
|
| 5 | + |
|
| 6 | +data F a = F a
|
|
| 7 | +instance Show a => Show (F a) where
|
|
| 8 | + show :: forall a. Show a => F a -> String
|
|
| 9 | + show (F x) = show x
|
|
| 10 | + |
|
| 11 | +{- Previously emitted error:
|
|
| 12 | + |
|
| 13 | + Could not deduce (Show a0)
|
|
| 14 | + from the context (Show a)
|
|
| 15 | + bound by the type signature for show :: Show a => F a -> String
|
|
| 16 | + at A.hs:8:13-45
|
|
| 17 | + The type variable ‘a0’ is ambiguous
|
|
| 18 | + When checking that:
|
|
| 19 | + forall a. Show a => forall a1. Show a1 => F a1 -> String
|
|
| 20 | + is more polymorphic than: forall a. Show a => F a -> String
|
|
| 21 | + When checking that instance signature for ‘show’
|
|
| 22 | + is more general than its signature in the class
|
|
| 23 | + Instance sig: forall a.
|
|
| 24 | + Show a =>
|
|
| 25 | + forall a1. Show a1 => F a1 -> String
|
|
| 26 | + Class sig: forall a. Show a => F a -> String
|
|
| 27 | + In the instance declaration for ‘Show (F a)’
|
|
| 28 | +-} |
| 1 | +T11141.hs:8:20: warning: [GHC-63397] [-Wname-shadowing (in -Wall)]
|
|
| 2 | + This binding for ‘a’ shadows the existing binding
|
|
| 3 | + bound at T11141.hs:7:10
|
|
| 4 | + |
| ... | ... | @@ -496,6 +496,7 @@ test('T10770b', expect_broken(10770), compile, ['']) |
| 496 | 496 | test('T10935', normal, compile, [''])
|
| 497 | 497 | test('T10971a', normal, compile, [''])
|
| 498 | 498 | test('T11062', [extra_files(['T11062.hs', 'T11062.hs-boot', 'T11062a.hs'])], multimod_compile, ['T11062', '-v0'])
|
| 499 | +test('T11141', normal, compile, ['-Wname-shadowing'])
|
|
| 499 | 500 | test('T11237', normal, compile, [''])
|
| 500 | 501 | test('T10592', normal, compile, [''])
|
| 501 | 502 | test('T11305', normal, compile, [''])
|