Give seq a more precise type and remove magic
`GHC.Prim.seq` previously had the rather plain type: seq :: forall a b. a -> b -> b However, it also had a special typing rule to applications where `b` is not of kind `Type`. Issue #17440 noted that levity polymorphism allows us to rather give it the more precise type: seq :: forall (r :: RuntimeRep) a (b :: TYPE r). a -> b -> b This allows us to remove the special typing rule that we previously required to allow applications on unlifted arguments. T9404 contains a non-Type application of `seq` which should verify that this works as expected. Closes #17440.
Showing
- compiler/basicTypes/MkId.hs 23 additions, 16 deletionscompiler/basicTypes/MkId.hs
- compiler/deSugar/DsUtils.hs 74 additions, 68 deletionscompiler/deSugar/DsUtils.hs
- compiler/simplCore/Simplify.hs 7 additions, 2 deletionscompiler/simplCore/Simplify.hs
- compiler/typecheck/TcExpr.hs 2 additions, 48 deletionscompiler/typecheck/TcExpr.hs
- testsuite/tests/simplCore/should_run/SeqRule.hs 1 addition, 1 deletiontestsuite/tests/simplCore/should_run/SeqRule.hs
- testsuite/tests/typecheck/should_compile/T13050.stderr 12 additions, 12 deletionstestsuite/tests/typecheck/should_compile/T13050.stderr
- testsuite/tests/typecheck/should_compile/T14590.stderr 16 additions, 16 deletionstestsuite/tests/typecheck/should_compile/T14590.stderr
- testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr 4 additions, 4 deletions...check/should_compile/abstract_refinement_hole_fits.stderr
- testsuite/tests/typecheck/should_compile/holes.stderr 1 addition, 1 deletiontestsuite/tests/typecheck/should_compile/holes.stderr
- testsuite/tests/typecheck/should_compile/holes3.stderr 1 addition, 1 deletiontestsuite/tests/typecheck/should_compile/holes3.stderr
- testsuite/tests/warnings/should_compile/PluralS.stderr 1 addition, 1 deletiontestsuite/tests/warnings/should_compile/PluralS.stderr
Loading
Please register or sign in to comment