Psi2ir: ignore unresolved class literals in annotations
Similarly to 38536638, skip annotation arguments that reference classes
which are not found in our compilation classpath.
This fix is especially needed because of the way _nested_ classes are
currently referenced in annotations. Since we don't generate all needed
InnerClasses attributes yet (KT-27936), we can't unambiguously resolve a
reference to a nested class in annotation arguments. This leads to an
ErrorValue loaded in the annotation descriptor. The old backend doesn't
care, since it doesn't look at that annotation or its arguments, but
psi2ir tries to convert all annotation arguments and it crashed with CCE
here, trying to cast IrErrorType to IrSimpleType.
This commit is contained in:
Vendored
+4
@@ -1,6 +1,10 @@
|
||||
package a
|
||||
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
interface A {
|
||||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.TYPE_PARAMETER)
|
||||
annotation class Anno(val value: String)
|
||||
}
|
||||
|
||||
annotation class K(val klass: KClass<*>)
|
||||
|
||||
Vendored
+2
-1
@@ -1,9 +1,10 @@
|
||||
package b
|
||||
|
||||
import a.A
|
||||
import a.*
|
||||
|
||||
@A.Anno("B")
|
||||
interface B {
|
||||
@A.Anno("foo")
|
||||
@K(A.Anno::class)
|
||||
fun <@A.Anno("T") T> foo(t: T) = t
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user