https://kotlinlang.org logo
Title
b

benleggiero

06/15/2018, 1:38 AM
Is there any way to call `super`’s initializer in
init
?
s

Shawn

06/15/2018, 1:46 AM
doesn’t appear to be the case 😕
b

benleggiero

06/15/2018, 4:08 AM
😕
a

arekolek

06/15/2018, 9:48 AM
Note that code in initializer blocks effectively becomes part of the primary constructor. Delegation to the primary constructor happens as the first statement of a secondary constructor, so the code in all initializer blocks is executed before the secondary constructor body. Even if the class has no primary constructor, the delegation still happens implicitly, and the initializer blocks are still executed
So if you call super primary constructor, you effectively call super init, I understand
b

benleggiero

06/16/2018, 8:45 PM
Yes, but my code is calling it too late. I want to initialize the `super`’s fields before I initialize mine…