[FIR] Initialize type for annotation arguments during deserialization

Get rid of IrErrorTypeImpl creating in FIR2IR
This commit is contained in:
Ivan Kochurkin
2022-04-27 15:57:29 +03:00
parent 0ef043b074
commit ad7c213ab2
18 changed files with 133 additions and 54 deletions
@@ -0,0 +1,43 @@
// TARGET_BACKEND: JVM
// MODULE: lib
// FILE: Enum.java
public enum Enum {
Value
}
// FILE: C.java
public class C {
}
// FILE: ArgumentsSource.java
public @interface ArgumentsSource {
Class<?> value();
}
// FILE: MethodSource.java
@ArgumentsSource(C.class)
public @interface MethodSource {
String[] value() default "";
}
// FILE: test.kt
import Enum
annotation class Ann(val e: Enum)
@Ann(Enum.Value) // Checking Java enchancement after deserialization
@MethodSource("getTestFiles")
fun test(): String {
return "OK"
}
// MODULE: main(lib)
// FILE: main.kt
@MethodSource("getTestFiles")
fun box(): String {
return test()
}
@@ -255,8 +255,8 @@ FILE fqName:<root> fileName:/C.kt
Annos(value = Anno(token = 'OK'))
Strings(value = 'OK')
Ints(value = '42')
Enums(value = GET_ENUM 'ENUM_ENTRY name:EA' type=IrErrorType(null))
Classes(value = CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Double modality:FINAL visibility:public superTypes:[kotlin.Number; kotlin.Comparable<kotlin.Double>; java.io.Serializable]' type=IrErrorType(null))
Enums(value = GET_ENUM 'ENUM_ENTRY name:EA' type=<root>.E)
Classes(value = CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Double modality:FINAL visibility:public superTypes:[kotlin.Number; kotlin.Comparable<kotlin.Double>; java.io.Serializable]' type=kotlin.reflect.KClass<kotlin.Double>)
overridden:
public open fun test (): kotlin.Unit declared in <root>.A
$this: VALUE_PARAMETER name:<this> type:<root>.A