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:
@@ -14209,6 +14209,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("forceWrapping.kt")
|
||||
public void testForceWrapping() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/reflection/kClassInAnnotation/forceWrapping.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("vararg.kt")
|
||||
public void testVararg() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/reflection/kClassInAnnotation/vararg.kt");
|
||||
@@ -14220,6 +14226,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/reflection/kClassInAnnotation/varargInJava.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("wrappingForCallableReferences.kt")
|
||||
public void testWrappingForCallableReferences() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/reflection/kClassInAnnotation/wrappingForCallableReferences.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/reflection/lambdaClasses")
|
||||
|
||||
Reference in New Issue
Block a user