FIR: convert Java type parameter bounds before reading annotations

This avoids a crash due to circular class references through annotation
arguments.
This commit is contained in:
pyos
2022-09-15 11:48:33 +02:00
committed by teamcity
parent 04dae17333
commit 5ba76ee757
11 changed files with 108 additions and 12 deletions
@@ -0,0 +1,18 @@
public open class ReferenceCycleThroughAnnotation : R|kotlin/Any| {
public constructor(): R|test/ReferenceCycleThroughAnnotation|
@R|test/ReferenceCycleThroughAnnotation.C|(value = <getClass>(<getClass>(R|ft<test/ReferenceCycleThroughAnnotation.B<ft<test/ReferenceCycleThroughAnnotation.A<*>, test/ReferenceCycleThroughAnnotation.A<*>?>>, test/ReferenceCycleThroughAnnotation.B<*>?>|))) public open inner class A<T : R|kotlin/Any!|> : R|kotlin/Any| {
public open fun foo(): R|kotlin/Unit|
public test/ReferenceCycleThroughAnnotation.constructor<T : R|kotlin/Any!|>(): R|test/ReferenceCycleThroughAnnotation.A<T>|
}
public open inner class B<T : R|ft<test/ReferenceCycleThroughAnnotation.A<ft<T & Any, T?>>, test/ReferenceCycleThroughAnnotation.A<ft<T & Any, T?>>?>|> : R|kotlin/Any| {
public test/ReferenceCycleThroughAnnotation.constructor<T : R|ft<test/ReferenceCycleThroughAnnotation.A<ft<T & Any, T?>>, test/ReferenceCycleThroughAnnotation.A<ft<T & Any, T?>>?>|>(): R|test/ReferenceCycleThroughAnnotation.B<T>|
}
public final annotation class C : R|kotlin/Annotation| {
public constructor(value: R|kotlin/reflect/KClass<*>|): R|test/ReferenceCycleThroughAnnotation.C|
}
}
@@ -0,0 +1,16 @@
package test;
public class ReferenceCycleThroughAnnotation {
@C(B.class)
public class A<T extends Object> {
public void foo() {
}
}
public class B<T extends A<T>> {
}
public @interface C {
public Class<?> value();
}
}
@@ -0,0 +1,19 @@
package test
public open class ReferenceCycleThroughAnnotation {
public constructor ReferenceCycleThroughAnnotation()
@test.ReferenceCycleThroughAnnotation.C(value = test.ReferenceCycleThroughAnnotation.B::class) public open inner class A</*0*/ T : kotlin.Any!> {
public constructor A</*0*/ T : kotlin.Any!>()
public open fun foo(): kotlin.Unit
}
public open inner class B</*0*/ T : test.ReferenceCycleThroughAnnotation.A<T!>!> {
public constructor B</*0*/ T : test.ReferenceCycleThroughAnnotation.A<T!>!>()
}
public final annotation class C : kotlin.Annotation {
public constructor C(/*0*/ value: kotlin.reflect.KClass<*>)
public final val value: kotlin.reflect.KClass<*>
}
}