Instantiation of annotations for JVM IR with the corresponding feature flag
Seperate checker for platforms that do not support this language feature yet Synthetic implementations of annotations are generated on-demand with proper equals, hashCode, and annotationType methods #KT-47699 Fixed
This commit is contained in:
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
// IGNORE_BACKEND: JVM
|
||||
// !LANGUAGE: +InstantiationOfAnnotationClasses
|
||||
|
||||
annotation class Foo(val int: Int)
|
||||
|
||||
annotation class Bar
|
||||
|
||||
fun box() {
|
||||
val foo = Foo(42)
|
||||
}
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
@kotlin.Metadata
|
||||
public synthetic final class AnnotationCtorCallGenerateSyntheticKt$annotationImpl$Foo$0 {
|
||||
// source: 'annotationCtorCallGenerateSynthetic.kt'
|
||||
private synthetic final field int: int
|
||||
public method <init>(p0: int): void
|
||||
public synthetic final method annotationType(): java.lang.Class
|
||||
public final method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public final method hashCode(): int
|
||||
public synthetic final method int(): int
|
||||
public final @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public synthetic inner class AnnotationCtorCallGenerateSyntheticKt$annotationImpl$Foo$0
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class AnnotationCtorCallGenerateSyntheticKt {
|
||||
// source: 'annotationCtorCallGenerateSynthetic.kt'
|
||||
public final static method box(): void
|
||||
public synthetic inner class AnnotationCtorCallGenerateSyntheticKt$annotationImpl$Foo$0
|
||||
}
|
||||
|
||||
@java.lang.annotation.Retention
|
||||
@kotlin.Metadata
|
||||
public annotation class Bar {
|
||||
// source: 'annotationCtorCallGenerateSynthetic.kt'
|
||||
}
|
||||
|
||||
@java.lang.annotation.Retention
|
||||
@kotlin.Metadata
|
||||
public annotation class Foo {
|
||||
// source: 'annotationCtorCallGenerateSynthetic.kt'
|
||||
public abstract method int(): int
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// !LANGUAGE: +InstantiationOfAnnotationClasses
|
||||
|
||||
annotation class Foo(val bar: Bar)
|
||||
|
||||
annotation class Bar
|
||||
|
||||
@Foo(Bar())
|
||||
fun box() {
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
@kotlin.Metadata
|
||||
public final class AnnotationCtorCallNoSyntheticKt {
|
||||
// source: 'annotationCtorCallNoSynthetic.kt'
|
||||
public final static @Foo method box(): void
|
||||
}
|
||||
|
||||
@java.lang.annotation.Retention
|
||||
@kotlin.Metadata
|
||||
public annotation class Bar {
|
||||
// source: 'annotationCtorCallNoSynthetic.kt'
|
||||
}
|
||||
|
||||
@java.lang.annotation.Retention
|
||||
@kotlin.Metadata
|
||||
public annotation class Foo {
|
||||
// source: 'annotationCtorCallNoSynthetic.kt'
|
||||
public abstract method bar(): Bar
|
||||
}
|
||||
Reference in New Issue
Block a user