Force wrapping java classes from annotation methods into KClasses
Before this change such wrapping happened only during coercion, i.e. when a call-site expected a KClass instance. But when call-site expects Any, for example, no wrapping happened, and raw j.l.Class instance was left on stack. The solution is to put wrapping code closer to generation of annotation's method call itself to guarantee that necessary wrapping will happen. #KT-9453 Fixed
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
@java.lang.annotation.Retention
|
||||
@kotlin.Metadata
|
||||
public annotation class Anno {
|
||||
public abstract method kClasses(): java.lang.Class[]
|
||||
public abstract method kClassesVararg(): java.lang.Class[]
|
||||
public abstract method klass(): java.lang.Class
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class ForceWrappingKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static @Anno method foo(): void
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
@java.lang.annotation.Retention
|
||||
@kotlin.Metadata
|
||||
public annotation class Anno {
|
||||
public abstract method kClasses(): java.lang.Class[]
|
||||
public abstract method kClassesVararg(): java.lang.Class[]
|
||||
public abstract method klass(): java.lang.Class
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class WrappingForCallableReferencesKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static method checkBoundReference(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function0): void
|
||||
public final static method checkBoundReferenceArray(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function0): void
|
||||
public final static method checkReference(@org.jetbrains.annotations.NotNull p0: Anno, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: kotlin.jvm.functions.Function1): void
|
||||
public final static method checkReferenceArray(@org.jetbrains.annotations.NotNull p0: Anno, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: kotlin.jvm.functions.Function1): void
|
||||
public final static @Anno method foo(): void
|
||||
}
|
||||
Reference in New Issue
Block a user