object: myList :by x or object:FooType by x has be...
# language-evolution
j
object: myList :by x or object:FooType by x has been kind of the opposite of improvement over intellij "replace inheritance by delegation". my heart leapt high into the air when i learned of this but came down hard when i read the chosen implmentation.
by
should be considered something like
extremelyvisibleaggregatememberVtable
because you basically can only send a call through a one-way wormhole to the instance named unless you manually (and without intellij's help) "replace delegation by overrides" at the container level. there should be
by
, which does what is documented now, and a v2
by
by some other clever infix name which does delegation through the declarator's vtable of that interface.
🤔 1
usecase:
class <T>ListOfOnly2(val listOf3OrMore:List<T>):List<T>  by listOf3OrMore{override val size get()=2}
had surprising results for me.