[FIR] Fix isValidTypeParameterFromOuterDeclaration check for local class

This fixes an IllegalArgumentException when
symbolProvider.getClassLikeSymbolByClassId is called with a local
class ID.

#KT-63656 Fixed
This commit is contained in:
Kirill Rakhman
2023-11-22 09:40:22 +01:00
committed by Space Team
parent a703f5afb8
commit 9ea4afe7c8
4 changed files with 46 additions and 52 deletions
@@ -1,3 +1,4 @@
// WITH_STDLIB
import A.B.D
import A.B.C
import A.B.D.Innermost
@@ -19,5 +20,24 @@ class A<T> {
val d: <!OUTER_CLASS_ARGUMENTS_REQUIRED("class 'B'")!>D<!>? = null
val innerMost: <!OUTER_CLASS_ARGUMENTS_REQUIRED("class 'B'")!>Innermost<!><String>? = null
fun foo() {
object {
val something = listOf<<!OUTER_CLASS_ARGUMENTS_REQUIRED!>B<!><String>>()
}
}
}
fun foo() {
object {
val something = listOf<<!OUTER_CLASS_ARGUMENTS_REQUIRED!>B<!><String>>() // False positive in K1 KT-63732
}
}
}
fun <T> bar() {
data class Example(val foo: Int)
object {
val something = listOf<Example>()
}
}