FIR checker: introduce top-level property checkers
Also, refactor property initializer checking so that those newly added property checkers as well as member property checker can share the same logic
This commit is contained in:
committed by
Mikhail Glukhikh
parent
f9378a3ab7
commit
57c8dd86a0
@@ -3,7 +3,7 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
interface T {
|
||||
val a: Int by Delegate()
|
||||
val a: Int by <!DELEGATED_PROPERTY_IN_INTERFACE!>Delegate()<!>
|
||||
}
|
||||
|
||||
class Delegate {
|
||||
|
||||
Vendored
+1
-1
@@ -15,7 +15,7 @@ expect class Foo(
|
||||
|
||||
constructor() : this("no")
|
||||
|
||||
val prop: String = "no"
|
||||
val prop: String = <!EXPECTED_PROPERTY_INITIALIZER!>"no"<!>
|
||||
|
||||
var getSet: String
|
||||
get() = "no"
|
||||
|
||||
+3
-3
@@ -14,8 +14,8 @@ expect class Foo {
|
||||
var varWithGetSet: String
|
||||
get set
|
||||
|
||||
val backingFieldVal: String = "no"
|
||||
var backingFieldVar: String = "no"
|
||||
val backingFieldVal: String = <!EXPECTED_PROPERTY_INITIALIZER!>"no"<!>
|
||||
var backingFieldVar: String = <!EXPECTED_PROPERTY_INITIALIZER!>"no"<!>
|
||||
|
||||
val customAccessorVal: String
|
||||
get() = "no"
|
||||
@@ -25,7 +25,7 @@ expect class Foo {
|
||||
|
||||
lateinit var lateinitVar: String
|
||||
|
||||
val delegated: String by Delegate
|
||||
val delegated: String by <!EXPECTED_DELEGATED_PROPERTY!>Delegate<!>
|
||||
}
|
||||
|
||||
object Delegate { operator fun getValue(x: Any?, y: Any?): String = "" }
|
||||
|
||||
compiler/testData/diagnostics/tests/multiplatform/topLevelProperty/differentKindsOfProperties.fir.kt
Vendored
+3
-3
@@ -17,8 +17,8 @@ expect var varWithPlatformGetSet: String
|
||||
expect get
|
||||
expect set
|
||||
|
||||
expect val backingFieldVal: String = "no"
|
||||
expect var backingFieldVar: String = "no"
|
||||
expect val backingFieldVal: String = <!EXPECTED_PROPERTY_INITIALIZER!>"no"<!>
|
||||
expect var backingFieldVar: String = <!EXPECTED_PROPERTY_INITIALIZER!>"no"<!>
|
||||
|
||||
expect val customAccessorVal: String
|
||||
get() = "no"
|
||||
@@ -30,7 +30,7 @@ expect const val constVal: Int
|
||||
|
||||
expect lateinit var lateinitVar: String
|
||||
|
||||
expect val delegated: String by Delegate
|
||||
expect val delegated: String by <!EXPECTED_DELEGATED_PROPERTY!>Delegate<!>
|
||||
object Delegate { operator fun getValue(x: Any?, y: Any?): String = "" }
|
||||
|
||||
fun test(): String {
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
expect fun foo1()
|
||||
expect val bar1 = 42
|
||||
expect val bar1 = <!EXPECTED_PROPERTY_INITIALIZER!>42<!>
|
||||
expect class Baz1
|
||||
|
||||
actual fun foo2() = 42
|
||||
|
||||
Reference in New Issue
Block a user