T2T in Patterns (#23739)
This patch implements the T2T (term-to-type) transformation in patterns. Patterns that are checked against a visible forall can now be written without the `type` keyword: \(type t) (x :: t) -> ... -- old \t (x :: t) -> ... -- new The `t` binder is parsed and renamed as a term pattern (Pat), but then undergoes a conversion to a type pattern (HsTyPat). See the new function pat_to_type_pat in compiler/GHC/Tc/Gen/Pat.hs
Showing
- compiler/GHC/HsToCore/Quote.hs 9 additions, 7 deletionscompiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Tc/Errors/Ppr.hs 14 additions, 14 deletionscompiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs 26 additions, 2 deletionscompiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Errors/Types/PromotionErr.hs 13 additions, 0 deletionscompiler/GHC/Tc/Errors/Types/PromotionErr.hs
- compiler/GHC/Tc/Gen/App.hs 7 additions, 7 deletionscompiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Head.hs 59 additions, 7 deletionscompiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/Pat.hs 67 additions, 2 deletionscompiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Types/Error/Codes.hs 1 addition, 0 deletionscompiler/GHC/Types/Error/Codes.hs
- testsuite/tests/module/mod132.stderr 2 additions, 2 deletionstestsuite/tests/module/mod132.stderr
- testsuite/tests/module/mod147.stderr 2 additions, 2 deletionstestsuite/tests/module/mod147.stderr
- testsuite/tests/rename/should_fail/RnStaticPointersFail02.stderr 2 additions, 2 deletions...te/tests/rename/should_fail/RnStaticPointersFail02.stderr
- testsuite/tests/rename/should_fail/T18740a.stderr 2 additions, 2 deletionstestsuite/tests/rename/should_fail/T18740a.stderr
- testsuite/tests/rename/should_fail/T18740b.stderr 1 addition, 1 deletiontestsuite/tests/rename/should_fail/T18740b.stderr
- testsuite/tests/th/T14627.stderr 2 additions, 2 deletionstestsuite/tests/th/T14627.stderr
- testsuite/tests/th/T18740c.stderr 1 addition, 1 deletiontestsuite/tests/th/T18740c.stderr
- testsuite/tests/type-data/should_fail/TDExpression.stderr 4 additions, 4 deletionstestsuite/tests/type-data/should_fail/TDExpression.stderr
- testsuite/tests/typecheck/should_fail/T19978.stderr 3 additions, 3 deletionstestsuite/tests/typecheck/should_fail/T19978.stderr
- testsuite/tests/vdq-rta/should_compile/T23739_idv.hs 36 additions, 0 deletionstestsuite/tests/vdq-rta/should_compile/T23739_idv.hs
- testsuite/tests/vdq-rta/should_compile/T23739_nested.hs 9 additions, 0 deletionstestsuite/tests/vdq-rta/should_compile/T23739_nested.hs
- testsuite/tests/vdq-rta/should_compile/T23739_sig.hs 41 additions, 0 deletionstestsuite/tests/vdq-rta/should_compile/T23739_sig.hs
Loading
Please register or sign in to comment