satyarth
05/12/2018, 7:56 AMinit
block and field initialization matter ?
class A(registry:Registry){
init{
registry.registerB(b)
}
val b:B= b=B()
}
Gives me a Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull
exception.
Moving the init
block after the initialization works.