02e327277e
In this commit reporting on member properties in init section of class is not supported (see KT-55528) ^KT-55493 Fixed
21 lines
393 B
Kotlin
Vendored
21 lines
393 B
Kotlin
Vendored
//KT-897 Don't allow assignment to a property before it is defined
|
|
|
|
package kt897
|
|
|
|
class A() {
|
|
init {
|
|
<!INITIALIZATION_BEFORE_DECLARATION!>i<!> = 11
|
|
}
|
|
val i : Int? = null // must be an error
|
|
|
|
init {
|
|
<!INITIALIZATION_BEFORE_DECLARATION!>j<!> = 1
|
|
}
|
|
var j : Int = 2
|
|
|
|
init {
|
|
<!INITIALIZATION_BEFORE_DECLARATION!>k<!> = 3
|
|
}
|
|
val k : Int
|
|
}
|