Fix parsing & printing of unboxed sums
The pretty-printing of partially applied unboxed sums was incorrect, as we incorrectly dropped the first half of the arguments, even for a partial application such as (# | #) @IntRep @DoubleRep Int# which lead to the nonsensical (# DoubleRep | Int# #). This patch also allows users to write unboxed sum type constructors such as (# | #) :: TYPE r1 -> TYPE r2 -> TYPE (SumRep '[r1,r2]). Fixes #20858 and #20859.
Showing
- compiler/GHC/Builtin/Types.hs 19 additions, 11 deletionscompiler/GHC/Builtin/Types.hs
- compiler/GHC/Driver/Session.hs 4 additions, 0 deletionscompiler/GHC/Driver/Session.hs
- compiler/GHC/Iface/Type.hs 21 additions, 6 deletionscompiler/GHC/Iface/Type.hs
- compiler/GHC/Parser.y 12 additions, 7 deletionscompiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs 10 additions, 0 deletionscompiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/Lexer.x 6 additions, 8 deletionscompiler/GHC/Parser/Lexer.x
- compiler/GHC/Tc/Errors/Ppr.hs 10 additions, 5 deletionscompiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs 7 additions, 3 deletionscompiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Validity.hs 14 additions, 6 deletionscompiler/GHC/Tc/Validity.hs
- compiler/GHC/Types/Basic.hs 18 additions, 0 deletionscompiler/GHC/Types/Basic.hs
- compiler/Language/Haskell/Syntax/Expr.hs 0 additions, 1 deletioncompiler/Language/Haskell/Syntax/Expr.hs
- docs/users_guide/9.4.1-notes.rst 13 additions, 0 deletionsdocs/users_guide/9.4.1-notes.rst
- docs/users_guide/exts/primitives.rst 15 additions, 0 deletionsdocs/users_guide/exts/primitives.rst
- testsuite/tests/typecheck/should_fail/T15067.stderr 5 additions, 7 deletionstestsuite/tests/typecheck/should_fail/T15067.stderr
- testsuite/tests/unboxedsums/T20858.hs 26 additions, 0 deletionstestsuite/tests/unboxedsums/T20858.hs
- testsuite/tests/unboxedsums/T20858.script 5 additions, 0 deletionstestsuite/tests/unboxedsums/T20858.script
- testsuite/tests/unboxedsums/T20858.stdout 18 additions, 0 deletionstestsuite/tests/unboxedsums/T20858.stdout
- testsuite/tests/unboxedsums/T20858b.script 5 additions, 0 deletionstestsuite/tests/unboxedsums/T20858b.script
- testsuite/tests/unboxedsums/T20858b.stdout 52 additions, 0 deletionstestsuite/tests/unboxedsums/T20858b.stdout
- testsuite/tests/unboxedsums/T20859.hs 10 additions, 0 deletionstestsuite/tests/unboxedsums/T20859.hs
Loading
Please register or sign in to comment