boxing of 'Float' in functions
Opened this issue · 0 comments
gavinking commented
Following on from #6614 and #6613, perhaps we could be even more aggressive about avoiding boxing of Number
as Float
. Currently we avoid boxing:
- within operator expressions or type
Float
, and - when specifying a local value of type
Float
(via=
or=>
).
In principle, I suppose, we could be even more aggressive about this, leaving Float
s unboxed
- when assigned to parameters of type
Float
, and - when returned from functions of type
Float
.
however I need to be much more careful about this because of polymorphism. A function with return type Float
can be assigned to the type Object(...)
, for example.