Delegated members should not be synthetic
Otherwise they are invisible to Java code
This commit is contained in:
@@ -737,7 +737,7 @@ public class FunctionCodegen extends ParentCodegenAwareImpl {
|
||||
Method overriddenMethod = jvmOverriddenMethodSignature.getAsmMethod();
|
||||
Method delegateMethod = jvmDelegateMethodSignature.getAsmMethod();
|
||||
|
||||
int flags = ACC_PUBLIC | ACC_SYNTHETIC; // TODO.
|
||||
int flags = ACC_PUBLIC;
|
||||
|
||||
MethodVisitor mv = v.newMethod(null, flags, delegateMethod.getName(), delegateMethod.getDescriptor(), null, null);
|
||||
if (state.getClassBuilderMode() != ClassBuilderMode.FULL) return;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
class JavaClass {
|
||||
public static void main(String[] args) {
|
||||
Test test = new Test();
|
||||
test.foo();
|
||||
test.getBar();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
trait Trait {
|
||||
fun foo()
|
||||
val bar: Int
|
||||
}
|
||||
|
||||
class Impl: Trait {
|
||||
override fun foo() {}
|
||||
override val bar = 1
|
||||
}
|
||||
|
||||
class Test : Trait by Impl()
|
||||
+5
@@ -112,6 +112,11 @@ public class CompileJavaAgainstKotlinTestGenerated extends AbstractCompileJavaAg
|
||||
doTest("compiler/testData/compileJavaAgainstKotlin/method/ArrayOfIntegerArray.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("Delegation.kt")
|
||||
public void testDelegation() throws Exception {
|
||||
doTest("compiler/testData/compileJavaAgainstKotlin/method/Delegation.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("GenericArray.kt")
|
||||
public void testGenericArray() throws Exception {
|
||||
doTest("compiler/testData/compileJavaAgainstKotlin/method/GenericArray.kt");
|
||||
|
||||
Reference in New Issue
Block a user