Invoke top level function with default argument using src class

This commit is contained in:
Natalia.Ukhorskaya
2013-04-09 16:25:21 +04:00
parent ce5ad80881
commit 1dce3b5da4
3 changed files with 10 additions and 1 deletions
@@ -581,7 +581,7 @@ public class FunctionCodegen extends GenerationStateAware {
JvmClassName ownerInternalName;
if (contextClass instanceof NamespaceDescriptor) {
ownerInternalName = NamespaceCodegen.getJVMClassNameForKotlinNs(DescriptorUtils.getFQName(contextClass).toSafe());
ownerInternalName = state.getTypeMapper().getOwner(functionDescriptor, kind, true);
}
else {
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");
}
@TestMetadata("topLevelFunWithDefaultArgs.kt")
public void testTopLevelFunWithDefaultArgs() throws Exception {
doTest("compiler/testData/codegen/bytecodeText/topLevelFunWithDefaultArgs.kt");
}
@TestMetadata("compiler/testData/codegen/bytecodeText/statements")
public static class Statements extends AbstractBytecodeTextTest {
public void testAllFilesPresentInStatements() throws Exception {