Re:Summary of Golang Generics Discussion
by qznc on Wednesday December 17, 2014 @04:46AM
(#8761717)
What I wonder is: Take "SortedList<T> where T:IComparable". Now there is a generic add(T t) method, which needs to call t.compareTo(x). As add does not know the dynamic type of t, we don't know the vtable offset of compareTo for compilation. Thus the compareTo call cannot be compiled to "load method pointer from vtable; call it". We need something more expensive or JIT magic (traces,guards,etc).
[ Parent
| on HN ]
There are no comments on this comment yet.