diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java index cf641f1ebb1..f8da9631918 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java @@ -508,7 +508,7 @@ public class FunctionCodegen extends ParentCodegenAwareImpl { Method jvmSignature = signature.getAsmMethod(); - int flags = ACC_PUBLIC | ACC_SYNTHETIC; // TODO. + int flags = getVisibilityAccessFlag(functionDescriptor) | getDeprecatedAccessFlag(functionDescriptor); Type ownerType; if (contextClass instanceof PackageFragmentDescriptor) { diff --git a/compiler/testData/compileJavaAgainstKotlin/method/DefaultMethod.java b/compiler/testData/compileJavaAgainstKotlin/method/DefaultMethod.java new file mode 100644 index 00000000000..44819374c47 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/DefaultMethod.java @@ -0,0 +1,6 @@ +class JavaClass { + public static void main(String[] args) { + _DefaultPackage.foo$default(1, 0); + } + +} \ No newline at end of file diff --git a/compiler/testData/compileJavaAgainstKotlin/method/DefaultMethod.kt b/compiler/testData/compileJavaAgainstKotlin/method/DefaultMethod.kt new file mode 100644 index 00000000000..f5b0c242c83 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/DefaultMethod.kt @@ -0,0 +1 @@ +fun foo(a: Int = 1) {} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileJavaAgainstKotlinTestGenerated.java b/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileJavaAgainstKotlinTestGenerated.java index 629f4d8bc60..2c8a8c10e9d 100644 --- a/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileJavaAgainstKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileJavaAgainstKotlinTestGenerated.java @@ -112,6 +112,11 @@ public class CompileJavaAgainstKotlinTestGenerated extends AbstractCompileJavaAg doTest("compiler/testData/compileJavaAgainstKotlin/method/ArrayOfIntegerArray.kt"); } + @TestMetadata("DefaultMethod.kt") + public void testDefaultMethod() throws Exception { + doTest("compiler/testData/compileJavaAgainstKotlin/method/DefaultMethod.kt"); + } + @TestMetadata("Delegation.kt") public void testDelegation() throws Exception { doTest("compiler/testData/compileJavaAgainstKotlin/method/Delegation.kt");