IdentityObject and InlineObject

Gernot Neppert gneppert at web.de
Tue Apr 14 09:02:02 UTC 2020


After reading through Brian Goetz's arguments in favour of abandoning
'InlineObject', I was wondering:

Couldn't it be useful to be able to overload a function based on the two
disjunct type-families?

For example, it may turn out to be more efficient to use two different
algorithms for inline- vs. non-inline types. So I might want to write this:

<T extends InlineObject> Heap<T> heapify(T...args) {

}

<T extends IdentifyObject> Heap<T> heapify(T...args) {

}

(If we had only 'IdentifyObject', the overload-set would contain
functions with non-disjunct argument-types, which is generally discouraged!)




More information about the valhalla-spec-comments mailing list