will following code cause boxing of integer passed call genericmethod
?
void genericmethod<t>(t value) { int test = (dynamic)value; } void main() { genericmethod(100); }
according c# specification §4.7 dynamic type:
dynamic
considered identicalobject
except in following respects:
operations on expressions of type
dynamic
can dynamically bound (§7.2.2).type inference (§7.5.2) prefer
dynamic
onobject
if both candidates.
so, casting dynamic
cause boxing in same way casting object
.
Comments
Post a Comment