IC: Fix regression in detecting constants in KotlinClassInfo.kt

A constant is a static final field with non-null value. In a previous
commit (0b09be7), we accidentally removed the *non-null value*
filter when looking for constants in the bytecode.

This commit re-adds that filter to make sure the detection is correct.

Test: Added KotlinOnlyClasspathChangesComputerTest.testDelegatedProperties

^KT-58986: Fixed
This commit is contained in:
Hung Nguyen
2023-06-16 15:28:39 +01:00
committed by Space Team
parent ff612f15cf
commit 078356164b
7 changed files with 47 additions and 2 deletions
@@ -0,0 +1,15 @@
package com.example
import kotlin.reflect.KProperty
var delegatedProperty: String by Delegate() // Added
class Delegate {
operator fun getValue(thisRef: Any?, property: KProperty<*>): String {
return "<Delegated>"
}
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) {
}
}
@@ -0,0 +1,13 @@
package com.example
import kotlin.reflect.KProperty
class Delegate {
operator fun getValue(thisRef: Any?, property: KProperty<*>): String {
return "<Delegated>"
}
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) {
}
}