farmerbb
02/01/2023, 4:55 PMinit block inside of an abstract class 🤦♂️Loney Chou
02/01/2023, 4:59 PMfarmerbb
02/01/2023, 4:59 PMAttempt to invoke interface method <name> on a null object reference that I couldn't reproducefarmerbb
02/01/2023, 5:00 PMPablichjenkov
02/01/2023, 5:11 PMfarmerbb
02/01/2023, 5:15 PMabstract class SomeAbstractClass(
scope: CoroutineScope
) {
protected abstract val someVal: SomeType
init {
scope.launch {
someVal.someFunction()
}
}
}farmerbb
02/01/2023, 5:17 PMsomeVal.someFunction() outside of the coroutine scope then the IDE warns me with Accessing non-final property <name> in constructor but no such warning while inside the coroutine scope.Pablichjenkov
02/01/2023, 5:29 PMfarmerbb
02/01/2023, 5:30 PMGleb Minaev
02/01/2023, 6:57 PMfun exec(block: () -> Unit) { block() }
abstract class SomeAbstractClass {
protected abstract val someVal: String
init {
exec {
someVal.length
}
}
}Pablichjenkov
02/01/2023, 7:05 PMPablichjenkov
02/01/2023, 7:40 PM