[FIR] Add INITIALIZATION_BEFORE_DECLARATION diagnostic
This commit is contained in:
committed by
teamcityserver
parent
b706e776ad
commit
d84cc4333c
Vendored
+1
-1
@@ -24,7 +24,7 @@ class Test2 {
|
||||
}
|
||||
}
|
||||
|
||||
a = "2"
|
||||
<!INITIALIZATION_BEFORE_DECLARATION!>a<!> = "2"
|
||||
t.some()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
//KT-897 Don't allow assignment to a property before it is defined
|
||||
|
||||
package kt897
|
||||
|
||||
class A() {
|
||||
init {
|
||||
i = 11
|
||||
}
|
||||
val i : Int? = null // must be an error
|
||||
|
||||
init {
|
||||
j = 1
|
||||
}
|
||||
var j : Int = 2
|
||||
|
||||
init {
|
||||
k = 3
|
||||
}
|
||||
val k : Int
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
//KT-897 Don't allow assignment to a property before it is defined
|
||||
|
||||
package kt897
|
||||
|
||||
Reference in New Issue
Block a user