[FIR] Add FirConstValWithGetterOrDelegateChecker

This commit is contained in:
Br0mm
2021-03-09 18:36:25 +03:00
committed by TeamCityServer
parent 93f711e2b8
commit 75e4c74256
15 changed files with 129 additions and 19 deletions
@@ -0,0 +1,33 @@
FILE: constValWithGetterOrDelegate.kt
public final const val f: R|kotlin/Int| = Int(24)
public get(): R|kotlin/Int|
public final const val l: R|kotlin/Int| = Int(3)
public get(): R|kotlin/Int|
public final const val k: R|kotlin/Int|
public get(): R|kotlin/Int|
public final const val t: R|kotlin/Int|
public get(): R|kotlin/Int| {
^ Int(24)
}
public final class Test : R|kotlin/Any| {
public constructor(): R|Test| {
super<R|kotlin/Any|>()
}
public final operator fun getValue(nothing: R|kotlin/Nothing?|, property: R|kotlin/reflect/KProperty<*>|): R|kotlin/Int| {
^getValue Int(123)
}
}
public final const val delegated: R|kotlin/Int|by R|/Test.Test|()
public get(): R|kotlin/Int| {
^ D|/delegated|.R|/Test.getValue|(Null(null), ::R|/delegated|)
}
public final const val e: R|kotlin/Boolean|
public get(): R|kotlin/Boolean| {
^ Boolean(false)
}
public final const val property: R|kotlin/String| = String(123)
public get(): R|kotlin/String| {
^ F|/property|.R|kotlin/String.plus|(String( 123 123))
}
@@ -0,0 +1,26 @@
import kotlin.reflect.KProperty
const val f = 24
const val l = 3
<!CONST_VAL_WITH_GETTER!>get<!>
<!MUST_BE_INITIALIZED!>const val k: Int<!>
<!CONST_VAL_WITH_GETTER!>get<!>
const val t: Int
<!CONST_VAL_WITH_GETTER!>get() = 24<!>
class Test {
operator fun getValue(nothing: Nothing?, property: KProperty<*>): Int {
return 123
}
}
const val delegated: Int by <!CONST_VAL_WITH_DELEGATE!>Test()<!>
const val e: Boolean
<!CONST_VAL_WITH_GETTER!>get() = false<!>
const val property: String = "123"
<!CONST_VAL_WITH_GETTER!>get() = field + " 123 123"<!>