Constant propagation of function of type

Assuming that the type of args is inferred, can I count on the compiler to constant prop the computation of X away so that it does not appear in the compiled code?

Generally yes for things that are specialized on (like types). Use Cthulhu to see what the compiler is actually doing with your code.

1 Like