There were two bugs here:
- We weren't ignoring Cast in size_up_app
- An application of a non-variable wasn't being charged correctly
The result was that some things looked too cheap. In my case I had
((f x) `cast` ...) y
which was given size 21 instead of 30, and this had knock-on effects
elsewhere that caused some large code bloat.