Kotlin / kotlin-spec

Kotlin Language Specification:
https://kotlinlang.org/spec
Apache License 2.0
393 stars 80 forks source link

Add details of how `val`/`var` properties work w.r.t. inheritance and overriding #59

Closed ice-phoenix closed 4 years ago

ice-phoenix commented 4 years ago
interface I1 {
    var ordinal: Int
}

interface I2 {
    val ordinal: Int
}

class Case1(override var ordinal: Int) : I2, I1

// ERROR!
class Case2(override val ordinal: Int) : I2, I1 // VAR_OVERRIDDEN_BY_VAL
ice-phoenix commented 4 years ago

Most important details done in #59