I don’t know how much optimization the JIT compiler will do, so this may be optimized away at runtime, but I thought it might would be worth it to provide an annotation that would allow you to write a single method that accepts a Number
but at compile time turns into a method each for each primitive number type. It might also could have parameters so you can selectively generate them, say if you only wanted int
, float
, and double
.
Can you, please, share some motivating use-case? What would be this feature useful for?