Envoyé par
Gavin King
So, the first possibility, as you've intuited, is that assignment of a
primitive to Any results in boxing, as it does today when you assign a
primitive to Object.
*However*, this approach actually does not result in the problem
you've described. Consider the possible concrete instantiations of
List:
- List<Any> - boxing, like today with List<Object>
- List<Object> - same as today
- List<int> - no boxing, since we can use the same specialization
approach used in the paper
The only case which involves boxing is a case which you disallow in
the current proposal, which means that this is not worse than the
current proposal.
Partager