Treat coercions as arguments for floating and inlining (fixes #17787)
This MR makes the changes suggested by @simonpj in #17787 (closed). Specifically:
-
It reverts the change in 8924224e and adds a Note describing the subtleties.
-
It modifies
SetLevels.notWorthFloating
to allow floating out expressions applied to coercions.
It also adds a Note about STG-level coercion tokens that incorporates some of Simon’s explanations in that issue thread.
I’ve added the example from #17787 (closed) as a test case, but with 8924224e reverted, I haven’t managed to figure out how to provoke the situation that the change to notWorthFloating
would address. Maybe Simon or someone else can suggest a test case for that, but if not, it doesn’t seem to affect any existing test cases, either, so it’s probably not that big a deal.