class Impl1(impl2: Impl2) : SomeInterface by impl2
u
ubu
03/22/2018, 1:46 PM
Thanks for suggestion.
The problem is that I initialize some heavy object in init{} of the first implementation, I would like to replace this process by initialization of some other object in second implementation.
d
diesieben07
03/22/2018, 1:50 PM
You should maybe extract the common parts of
Impl1
and
Impl2
into a common abstract base class, which both then extend.
u
ubu
03/22/2018, 4:57 PM
I’ve just tried. Seems to be exactly what I need. Thanks a lot, @diesieben07. 👍