Tidy up error messages for TypeAbstractions
1. Print the '@' symbol before invisible patterns and improve phrasing: T24557c.hs:8:4: error: [GHC-11983] - Invisible type pattern pat is not allowed here + Illegal invisible type pattern: @pat + An invisible type pattern must occur in an argument position. 2. Use a single error code for all type abstractions deemed illegal due to the TypeAbstractions extension being disabled. Before this change: * [GHC-78249] was used in function equations, lambdas * [GHC-17916] was used in constructor patterns After this change: * [GHC-78249] is used to report all illegal type abstractions * [GHC-17916] is no longer used There was no reason for both error codes to exist and this distinction was a source of complexity in GHC/Tc/Errors/* and GHC/Rename/Pat.hs 3. Group the different "invisible type pattern" error constructors under a single parent constructor, TcRnIllegalInvisibleTypePattern containing BadInvisPatReason
Showing
- compiler/GHC/Rename/Pat.hs 9 additions, 16 deletionscompiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Utils.hs 1 addition, 1 deletioncompiler/GHC/Rename/Utils.hs
- compiler/GHC/Tc/Errors/Ppr.hs 21 additions, 38 deletionscompiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs 36 additions, 40 deletionscompiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Pat.hs 3 additions, 2 deletionscompiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Types/Error/Codes.hs 7 additions, 7 deletionscompiler/GHC/Types/Error/Codes.hs
- testsuite/tests/rename/should_fail/T17594b.hs 1 addition, 6 deletionstestsuite/tests/rename/should_fail/T17594b.hs
- testsuite/tests/rename/should_fail/T17594b.stderr 40 additions, 45 deletionstestsuite/tests/rename/should_fail/T17594b.stderr
- testsuite/tests/rename/should_fail/T17594b_th.hs 9 additions, 0 deletionstestsuite/tests/rename/should_fail/T17594b_th.hs
- testsuite/tests/rename/should_fail/T17594b_th.stderr 5 additions, 0 deletionstestsuite/tests/rename/should_fail/T17594b_th.stderr
- testsuite/tests/rename/should_fail/T22478e.stderr 21 additions, 21 deletionstestsuite/tests/rename/should_fail/T22478e.stderr
- testsuite/tests/rename/should_fail/all.T 2 additions, 1 deletiontestsuite/tests/rename/should_fail/all.T
- testsuite/tests/th/T24557a.stderr 3 additions, 2 deletionstestsuite/tests/th/T24557a.stderr
- testsuite/tests/th/T24557b.stderr 3 additions, 2 deletionstestsuite/tests/th/T24557b.stderr
- testsuite/tests/th/T24557c.stderr 3 additions, 2 deletionstestsuite/tests/th/T24557c.stderr
- testsuite/tests/th/T24557d.stderr 3 additions, 2 deletionstestsuite/tests/th/T24557d.stderr
- testsuite/tests/typecheck/should_fail/T17594c.stderr 3 additions, 2 deletionstestsuite/tests/typecheck/should_fail/T17594c.stderr
- testsuite/tests/typecheck/should_fail/T17594d.stderr 3 additions, 2 deletionstestsuite/tests/typecheck/should_fail/T17594d.stderr
- testsuite/tests/typecheck/should_fail/T17594g.stderr 3 additions, 2 deletionstestsuite/tests/typecheck/should_fail/T17594g.stderr
- testsuite/tests/typecheck/should_fail/T19109.stderr 3 additions, 3 deletionstestsuite/tests/typecheck/should_fail/T19109.stderr
Loading
Please register or sign in to comment