Simon Jakobi pushed to branch wip/sjakobi/T22637-v2 at Glasgow Haskell Compiler / GHC
Commits:
-
bcd7d99b
by Simon Jakobi at 2026-04-10T18:53:13+02:00
-
d318c190
by Simon Jakobi at 2026-04-10T20:19:16+02:00
7 changed files:
- compiler/GHC/Tc/Errors/Ppr.hs
- testsuite/tests/patsyn/should_fail/T14114.stderr
- testsuite/tests/patsyn/should_fail/all.T
- testsuite/tests/rename/should_fail/all.T
- testsuite/tests/rename/should_fail/rnfail004.stderr
- testsuite/tests/typecheck/should_fail/all.T
- testsuite/tests/typecheck/should_fail/tcfail038.stderr
Changes:
| ... | ... | @@ -3479,6 +3479,11 @@ instance Diagnostic TcRnMessage where |
| 3479 | 3479 | NE.fromList $
|
| 3480 | 3480 | sortBy leftmost_smallest $
|
| 3481 | 3481 | map (getLocA . fst) (NE.toList pairs)
|
| 3482 | + TcRnBindingNameConflict _ locs
|
|
| 3483 | + -> Just $
|
|
| 3484 | + NE.fromList $
|
|
| 3485 | + sortBy leftmost_smallest $
|
|
| 3486 | + NE.toList locs
|
|
| 3482 | 3487 | _ ->
|
| 3483 | 3488 | Nothing
|
| 3484 | 3489 |
| 1 | 1 | |
| 2 | 2 | T14114.hs:4:20: error: [GHC-10498]
|
| 3 | - • Conflicting definitions for ‘a’
|
|
| 3 | + • Conflicting definitions for 'a'
|
|
| 4 | 4 | Bound at: T14114.hs:4:20
|
| 5 | 5 | T14114.hs:4:22
|
| 6 | 6 | • In a pattern synonym declaration
|
| 7 | + |
|
|
| 8 | +4 | pattern Foo1 a <- (a,a)
|
|
| 9 | + | ^
|
|
| 10 | + |
|
|
| 11 | +4 | pattern Foo1 a <- (a,a)
|
|
| 12 | + | ^
|
|
| 7 | 13 | |
| 8 | 14 | T14114.hs:5:20: error: [GHC-10498]
|
| 9 | - • Conflicting definitions for ‘a’
|
|
| 15 | + • Conflicting definitions for 'a'
|
|
| 10 | 16 | Bound at: T14114.hs:5:20
|
| 11 | 17 | T14114.hs:5:22
|
| 12 | 18 | • In a pattern synonym declaration
|
| 19 | + |
|
|
| 20 | +5 | pattern Foo2 a = (a,a)
|
|
| 21 | + | ^
|
|
| 22 | + |
|
|
| 23 | +5 | pattern Foo2 a = (a,a)
|
|
| 24 | + | ^
|
|
| 13 | 25 | |
| 14 | 26 | T14114.hs:6:20: error: [GHC-10498]
|
| 15 | - • Conflicting definitions for ‘a’
|
|
| 27 | + • Conflicting definitions for 'a'
|
|
| 16 | 28 | Bound at: T14114.hs:6:20
|
| 17 | 29 | T14114.hs:6:22
|
| 18 | 30 | • In a pattern synonym declaration
|
| 31 | + |
|
|
| 32 | +6 | pattern Foo3 a <- (a,a) where
|
|
| 33 | + | ^
|
|
| 34 | + |
|
|
| 35 | +6 | pattern Foo3 a <- (a,a) where
|
|
| 36 | + | ^ |
| ... | ... | @@ -40,7 +40,7 @@ test('T26465', normal, compile_fail, ['']) |
| 40 | 40 | test('T13349', normal, compile_fail, [''])
|
| 41 | 41 | test('T13470', normal, compile_fail, [''])
|
| 42 | 42 | test('T14112', normal, compile_fail, [''])
|
| 43 | -test('T14114', normal, compile_fail, [''])
|
|
| 43 | +test('T14114', normal, compile_fail, ['-fdiagnostics-show-caret'])
|
|
| 44 | 44 | test('T14507', normal, compile_fail, ['-dsuppress-uniques'])
|
| 45 | 45 | test('T15289', normal, compile_fail, [''])
|
| 46 | 46 | test('T15685', normal, compile_fail, [''])
|
| 1 | 1 | test('rnfail001', normal, compile_fail, [''])
|
| 2 | 2 | test('rnfail002', normal, compile_fail, [''])
|
| 3 | 3 | test('rnfail003', normal, compile_fail, [''])
|
| 4 | -test('rnfail004', normal, compile_fail, [''])
|
|
| 4 | +test('rnfail004', normal, compile_fail, ['-fdiagnostics-show-caret'])
|
|
| 5 | 5 | test('rnfail007', normal, compile_fail, [''])
|
| 6 | 6 | test('rnfail008', normal, compile_fail, [''])
|
| 7 | 7 | test('rnfail009', normal, compile_fail, [''])
|
| 1 | 1 | |
| 2 | -rnfail004.hs:6:5: [GHC-10498]
|
|
| 3 | - Conflicting definitions for ‘a’
|
|
| 2 | +rnfail004.hs:6:5: error: [GHC-10498]
|
|
| 3 | + Conflicting definitions for 'a'
|
|
| 4 | 4 | Bound at: rnfail004.hs:6:5
|
| 5 | 5 | rnfail004.hs:7:10
|
| 6 | + |
|
|
| 7 | +6 | a = []
|
|
| 8 | + | ^
|
|
| 9 | + |
|
|
| 10 | +7 | (b,c,a) = ([],[],d)
|
|
| 11 | + | ^
|
|
| 6 | 12 | |
| 7 | -rnfail004.hs:7:6: [GHC-10498]
|
|
| 8 | - Conflicting definitions for ‘b’
|
|
| 13 | +rnfail004.hs:7:6: error: [GHC-10498]
|
|
| 14 | + Conflicting definitions for 'b'
|
|
| 9 | 15 | Bound at: rnfail004.hs:7:6
|
| 10 | 16 | rnfail004.hs:8:8
|
| 17 | + |
|
|
| 18 | +7 | (b,c,a) = ([],[],d)
|
|
| 19 | + | ^
|
|
| 20 | + |
|
|
| 21 | +8 | [d,b,_] = ([],a,[])
|
|
| 22 | + | ^ |
| ... | ... | @@ -31,7 +31,7 @@ test('tcfail034', normal, compile_fail, ['']) |
| 31 | 31 | test('tcfail035', normal, compile_fail, [''])
|
| 32 | 32 | test('tcfail036', normal, compile_fail, [''])
|
| 33 | 33 | test('tcfail037', normal, compile_fail, [''])
|
| 34 | -test('tcfail038', normal, compile_fail, [''])
|
|
| 34 | +test('tcfail038', normal, compile_fail, ['-fdiagnostics-show-caret'])
|
|
| 35 | 35 | test('tcfail040', normal, compile_fail, [''])
|
| 36 | 36 | test('tcfail041', normal, compile_fail, [''])
|
| 37 | 37 | test('tcfail042', normal, compile_fail, [''])
|
| 1 | 1 | |
| 2 | -tcfail038.hs:7:11: [GHC-10498]
|
|
| 3 | - Conflicting definitions for ‘==’
|
|
| 2 | +tcfail038.hs:7:11: error: [GHC-10498]
|
|
| 3 | + Conflicting definitions for '=='
|
|
| 4 | 4 | Bound at: tcfail038.hs:7:11-12
|
| 5 | 5 | tcfail038.hs:9:11-12
|
| 6 | + |
|
|
| 7 | +7 | a == b = True
|
|
| 8 | + | ^^
|
|
| 9 | + |
|
|
| 10 | +9 | a == b = False
|
|
| 11 | + | ^^
|
|
| 6 | 12 | |
| 7 | -tcfail038.hs:8:11: [GHC-10498]
|
|
| 8 | - Conflicting definitions for ‘/=’
|
|
| 13 | +tcfail038.hs:8:11: error: [GHC-10498]
|
|
| 14 | + Conflicting definitions for '/='
|
|
| 9 | 15 | Bound at: tcfail038.hs:8:11-12
|
| 10 | 16 | tcfail038.hs:10:11-12
|
| 17 | + |
|
|
| 18 | + 8 | a /= b = False
|
|
| 19 | + | ^^
|
|
| 20 | + |
|
|
| 21 | +10 | a /= b = True
|
|
| 22 | + | ^^ |