methods on objects should always be called via invokevirtual() and not invokeinterface()
This commit is contained in:
@@ -165,7 +165,7 @@ public class JetTypeMapper {
|
||||
|
||||
public boolean isInterface(ClassDescriptor jetClass, OwnerKind kind) {
|
||||
PsiElement declaration = bindingContext.getDeclarationPsiElement(jetClass);
|
||||
if (declaration instanceof JetObjectDeclaration && ((JetObjectDeclaration) declaration).isObjectLiteral()) {
|
||||
if (declaration instanceof JetObjectDeclaration) {
|
||||
return false;
|
||||
}
|
||||
return kind == OwnerKind.INTERFACE;
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
object A {
|
||||
fun result() = "OK"
|
||||
}
|
||||
|
||||
fun box(): String = A.result()
|
||||
@@ -11,4 +11,8 @@ public class ObjectGenTest extends CodegenTestCase {
|
||||
public void testObjectLiteral() throws Exception {
|
||||
blackBoxFile("objects/objectLiteral.jet");
|
||||
}
|
||||
|
||||
public void testMethodOnObject() throws Exception {
|
||||
blackBoxFile("objects/methodOnObject.jet");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user