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
@@ -290,6 +290,19 @@ class KotlinOnlyClasspathChangesComputerTest : ClasspathChangesComputerTest() {
).assertEquals(changes)
}
/** Regression test for KT-58986.*/
@Test
fun testDelegatedProperties() {
// Check that classpath changes computation doesn't fail
val changes = computeClasspathChanges(File(testDataDir, "KotlinOnly/testDelegatedProperties/src"), tmpDir)
Changes(
lookupSymbols = setOf(
LookupSymbol(name = "delegatedProperty", scope = "com.example"),
),
fqNames = setOf("com.example")
).assertEquals(changes)
}
/** Tests [SupertypesInheritorsImpact]. */
@Test
override fun testImpactComputation_SupertypesInheritors() {