Closed
Description
This isn't a huge problem, because the deadargelim
pass can remove it if the function is internal and the address isn't taken and passed around non-trivially.
Without the environment parameter, creating a (boxed) closure would require making a local wrapper function making a cheap static tail call to the real function.
I don't think replacing a single virtual call with a virtual call and an extra static call will matter much. If we ended up adding unboxed closures to the type system, there would be fewer cases where this would be necessary.
It's hard to say what the best compromise would be.