[resolution] KotlinJavaPsiFacade: do not return classes with wrong ClassId

We shouldn't return from `findClass`/`findClasses` Java classes with
`ClassId` different from the requested one

^KT-62892
This commit is contained in:
Dmitrii Gridin
2024-01-03 20:08:43 +01:00
committed by Space Team
parent c6004874c1
commit 37ccf5d4f3
4 changed files with 29 additions and 32 deletions
+5 -5
View File
@@ -1,7 +1,7 @@
compiler/testData/cli/jvm/javaSrcWrongPackage.kt:1:13: error: unresolved reference 'A'.
fun test(): A.Nested = A().nested()
^
compiler/testData/cli/jvm/javaSrcWrongPackage.kt:1:24: error: unresolved reference 'A'.
compiler/testData/cli/jvm/javaSrcWrongPackage.kt:1:24: error: return type mismatch: expected 'A.Nested', actual 'foo.A.Nested!'.
fun test(): A.Nested = A().nested()
^
COMPILATION_ERROR
compiler/testData/cli/jvm/javaSrcWrongPackage.kt:1:28: error: cannot access class 'foo.A.Nested'. Check your module classpath for missing or conflicting dependencies.
fun test(): A.Nested = A().nested()
^
COMPILATION_ERROR