Reputation: 178
I'm using Kotlin & MVP together and stumbled on a little annoyance.
I'm getting an "accidental override" error (as you can tell from below). Are there any resolutions to this, besides changing either the member variable name or the getX() in the MainView interface.
From what i researched, there isn't a way to prevent kotlin from generating the getter for 'x'.
class MainActivity : Activity(), MainView {
val x: String // Accidental override
override fun getX(): String {
return x
}
}
interface MainView {
fun getX(): String
}
Upvotes: 2
Views: 205