Fix safe call on a static method in JVM back-end
#KT-5796 Fixed
This commit is contained in:
@@ -1754,8 +1754,10 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
|||||||
return StackValue.field(type, type, descriptor.getName().asString(), true);
|
return StackValue.field(type, type, descriptor.getName().asString(), true);
|
||||||
}
|
}
|
||||||
ClassDescriptor classObjectDescriptor = classDescriptor.getClassObjectDescriptor();
|
ClassDescriptor classObjectDescriptor = classDescriptor.getClassObjectDescriptor();
|
||||||
assert classObjectDescriptor != null : "Class object is not found for " + descriptor;
|
if (classObjectDescriptor != null) {
|
||||||
return StackValue.singleton(classObjectDescriptor, typeMapper);
|
return StackValue.singleton(classObjectDescriptor, typeMapper);
|
||||||
|
}
|
||||||
|
return StackValue.none();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (descriptor instanceof TypeParameterDescriptor) {
|
if (descriptor instanceof TypeParameterDescriptor) {
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
fun box(): String = if (Thread?.currentThread() != null) "OK" else "Fail"
|
||||||
@@ -5647,6 +5647,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("staticCall.kt")
|
||||||
|
public void testStaticCall() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/safeCall/staticCall.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/samConstructors")
|
@TestMetadata("compiler/testData/codegen/box/samConstructors")
|
||||||
|
|||||||
Reference in New Issue
Block a user