What I wanted was to get the backing field created and initial value passed to the constructor all at once, one of the Kotlin conveniences that we got too used to, I guess...
t
tehbilly
05/29/2019, 5:54 PM
Switching to replies instead of using main channel, dunno which is preferred here.
Copy code
class KotlinChild(x: String) : JavaAbstractParent() {
private val xProp = x
override fun getX(): String = xProp
}
tehbilly
05/29/2019, 5:54 PM
That's how I'd handle it if there was no field in
JavaAbstractParent
already, or something along those lines.
d
dave08
05/30/2019, 4:55 AM
That's what I did, I was just surprised that the other way didn't work... thanks!
t
tehbilly
05/30/2019, 12:28 PM
Sorry I couldn't provide more help, then! Might be my age showing, but I actually am glad that implicit setters/getters aren't capable of implementing things like that, I like to be explicit. Either way, glad you've got something working at least. o7