Fix safe call on a static method in JVM back-end

#KT-5796 Fixed
This commit is contained in:
Alexander Udalov
2014-09-18 11:13:30 +04:00
parent 9434114c45
commit c0a8e8a4fc
3 changed files with 11 additions and 2 deletions
@@ -1754,8 +1754,10 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
return StackValue.field(type, type, descriptor.getName().asString(), true);
}
ClassDescriptor classObjectDescriptor = classDescriptor.getClassObjectDescriptor();
assert classObjectDescriptor != null : "Class object is not found for " + descriptor;
return StackValue.singleton(classObjectDescriptor, typeMapper);
if (classObjectDescriptor != null) {
return StackValue.singleton(classObjectDescriptor, typeMapper);
}
return StackValue.none();
}
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);
}
@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")