KT-65425 [SLC] Correctly compute getQualifiedName for generated classes

Since the declarations generated by compiler plugins do not have proper
PSI (`classOrObjectDeclaration` in this case), we need to resort to
symbols for such declarations to compute the proper qualified name

^KT-65425 Fixed
This commit is contained in:
Roman Golyshev
2024-01-31 10:18:14 +01:00
committed by Space Team
parent 6271f5cbe5
commit a55b8d30fd
12 changed files with 89 additions and 1 deletions
@@ -0,0 +1,7 @@
public final class TestClass /* test.TestClass*/ {
private final error.NonExistentClass usage;
public TestClass();// .ctor()
public final error.NonExistentClass getUsage();// getUsage()
}
@@ -0,0 +1,7 @@
public final class TestClass /* test.TestClass*/ {
private final MyClass.Companion usage;
public TestClass();// .ctor()
public final MyClass.Companion getUsage();// getUsage()
}
@@ -0,0 +1,26 @@
// test.TestClass
// Java code does not see declarations generated by compiler plugins, see KT-65454
// COMPILATION_ERRORS
// WITH_FIR_TEST_COMPILER_PLUGIN
// FILE: main.kt
package test
import org.jetbrains.kotlin.fir.plugin.CompanionWithFoo
@CompanionWithFoo
class MyClass
class TestClass {
val usage = CompanionProvider.provide()
}
// FILE: test/JavaClass.java
package test;
public class CompanionProvider {
// generated MyClass.Companion type reference in java
public static MyClass.Companion provide() { return null; }
}