Invoke top level function with default argument using src class
This commit is contained in:
@@ -581,7 +581,7 @@ public class FunctionCodegen extends GenerationStateAware {
|
|||||||
|
|
||||||
JvmClassName ownerInternalName;
|
JvmClassName ownerInternalName;
|
||||||
if (contextClass instanceof NamespaceDescriptor) {
|
if (contextClass instanceof NamespaceDescriptor) {
|
||||||
ownerInternalName = NamespaceCodegen.getJVMClassNameForKotlinNs(DescriptorUtils.getFQName(contextClass).toSafe());
|
ownerInternalName = state.getTypeMapper().getOwner(functionDescriptor, kind, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ownerInternalName = JvmClassName.byType(state.getTypeMapper()
|
ownerInternalName = JvmClassName.byType(state.getTypeMapper()
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
fun foo(a: Int = 1) {}
|
||||||
|
|
||||||
|
//0 _DefaultPackage.foo
|
||||||
|
//3 INVOKESTATIC _DefaultPackage\$src\$
|
||||||
@@ -77,6 +77,11 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
|
|||||||
doTest("compiler/testData/codegen/bytecodeText/privateDefaultArgs.kt");
|
doTest("compiler/testData/codegen/bytecodeText/privateDefaultArgs.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("topLevelFunWithDefaultArgs.kt")
|
||||||
|
public void testTopLevelFunWithDefaultArgs() throws Exception {
|
||||||
|
doTest("compiler/testData/codegen/bytecodeText/topLevelFunWithDefaultArgs.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/bytecodeText/statements")
|
@TestMetadata("compiler/testData/codegen/bytecodeText/statements")
|
||||||
public static class Statements extends AbstractBytecodeTextTest {
|
public static class Statements extends AbstractBytecodeTextTest {
|
||||||
public void testAllFilesPresentInStatements() throws Exception {
|
public void testAllFilesPresentInStatements() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user