diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-06-21 12:42:53 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-06-23 14:12:04 -0400 |
commit | 4ae71eba8c1f680f3163fa27fd83cc5a5214770a (patch) | |
tree | eeeacdd08cf0250a5ae07b99ccff63d3ab1e9650 /testsuite/tests/codeGen/should_fail/T13233.hs | |
parent | cd753410da64bc1c2b1e8a9dc0331e96f4990004 (diff) | |
download | haskell-4ae71eba8c1f680f3163fa27fd83cc5a5214770a.tar.gz |
Don't eta-expand unsaturated primopswip/T16846
Previously, as described in Note [Primop wrappers], `hasNoBinding` would
return False in the case of `PrimOpId`s. This would result in eta
expansion of unsaturated primop applications during CorePrep. Not only
did this expansion result in unnecessary allocations, but it also meant
lead to rather nasty inconsistencies between the CAFfy-ness
determinations made by TidyPgm and CorePrep.
This fixes #16846.
Diffstat (limited to 'testsuite/tests/codeGen/should_fail/T13233.hs')
-rw-r--r-- | testsuite/tests/codeGen/should_fail/T13233.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/testsuite/tests/codeGen/should_fail/T13233.hs b/testsuite/tests/codeGen/should_fail/T13233.hs index f24fc03bfb..a8d2343e65 100644 --- a/testsuite/tests/codeGen/should_fail/T13233.hs +++ b/testsuite/tests/codeGen/should_fail/T13233.hs @@ -21,6 +21,9 @@ obscure _ = () quux :: () quux = obscure (#,#) +-- It used to be that primops has no binding. However, as described in +-- Note [Primop wrappers] in PrimOp we now rewrite unsaturated primop +-- applications to their wrapper, which allows safe use of levity polymorphism. primop :: forall (rep :: RuntimeRep) (a :: TYPE rep) b c. a -> b -> (State# RealWorld -> (# State# RealWorld, c #)) -> State# RealWorld -> (# State# RealWorld, Weak# b #) |