Update compiler tests to use KProperty instead of PropertyMetadata
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
// This test was adapted from compiler/testData/codegen/boxWithStdlib/callableReference/property/.
|
||||
package foo
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
object NumberDecrypter {
|
||||
fun getValue(instance: Any?, data: PropertyMetadata) = when (data.name) {
|
||||
fun getValue(instance: Any?, data: KProperty<*>) = when (data.name) {
|
||||
"four" -> 4
|
||||
"two" -> 2
|
||||
else -> throw Exception()
|
||||
|
||||
+4
-2
@@ -1,14 +1,16 @@
|
||||
// This test was adapted from compiler/testData/codegen/boxWithStdlib/callableReference/property/.
|
||||
package foo
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
object Delegate {
|
||||
var value = "lol"
|
||||
|
||||
fun getValue(instance: Any?, data: PropertyMetadata): String {
|
||||
fun getValue(instance: Any?, data: KProperty<*>): String {
|
||||
return value
|
||||
}
|
||||
|
||||
fun setValue(instance: Any?, data: PropertyMetadata, newValue: String) {
|
||||
fun setValue(instance: Any?, data: KProperty<*>, newValue: String) {
|
||||
value = newValue
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user