Closed kaikoga closed 4 years ago
Haxe supports covariant return types, so we can just coerce fields and let the compiler do plumbing (because reference ds fields are already always (get, never)
and to also comply it on value ds fields seems natural)
@:multiType
No, no, no, no, no, no
We can no longer allow setters for collections if we actually start coercing... but is that an issue?
The correct way to set virtual collections is by value, or in other words, clear() and CollectionOp.copy()
. Arbitrary implementation SHOULD NOT be injected later from outside, EVEN IF the collection is defined virtual. (Implementation is hard coded when defined by concrete ds anyway)
Non-concrete ds types cannot be inlined, so slow (allocates iterators) Currently value ds fields are not coerced.
Hard part: How to define a Haxe interface of coerced ds types? (maybe we can use @:multitype abstracts)