Added 'synthetic' flag for bridge method.

#KT-3155 fixed
This commit is contained in:
Evgeny Gerashchenko
2012-12-13 14:33:08 +04:00
parent e324d3914f
commit b8eb0c84ff
6 changed files with 27 additions and 1 deletions
@@ -743,7 +743,7 @@ public class FunctionCodegen extends GenerationStateAware {
FunctionDescriptor functionDescriptor,
Method overridden
) {
int flags = ACC_PUBLIC | ACC_BRIDGE; // TODO.
int flags = ACC_PUBLIC | ACC_BRIDGE | ACC_SYNTHETIC; // TODO.
final MethodVisitor mv = v.newMethod(null, flags, jvmSignature.getName(), overridden.getDescriptor(), null, null);
if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) {
@@ -0,0 +1,5 @@
package test
class PropagateSubclassOfComparable(): Comparable<PropagateSubclassOfComparable> {
override fun compareTo(other: PropagateSubclassOfComparable): Int = throw IllegalStateException()
}
@@ -0,0 +1,6 @@
namespace test
internal final class test.PropagateSubclassOfComparable : jet.Comparable<test.PropagateSubclassOfComparable> {
public final /*constructor*/ fun <init>(): test.PropagateSubclassOfComparable
public open override /*1*/ fun compareTo(/*0*/ other: test.PropagateSubclassOfComparable): jet.Int
}
@@ -336,6 +336,11 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/fun"), "kt", true);
}
@TestMetadata("PropagateSubclassOfComparable.kt")
public void testPropagateSubclassOfComparable() throws Exception {
doTest("compiler/testData/loadKotlin/fun/PropagateSubclassOfComparable.kt");
}
@TestMetadata("compiler/testData/loadKotlin/fun/genericWithTypeVariables")
public static class GenericWithTypeVariables extends AbstractLoadCompiledKotlinTest {
public void testAllFilesPresentInGenericWithTypeVariables() throws Exception {
@@ -70,6 +70,11 @@ public class LazyResolveDescriptorRendererTestGenerated extends AbstractLazyReso
doTest("compiler/testData/renderer/InheritedMembersVisibility.kt");
}
@TestMetadata("KeywordsInNames.kt")
public void testKeywordsInNames() throws Exception {
doTest("compiler/testData/renderer/KeywordsInNames.kt");
}
@TestMetadata("TupleTypes.kt")
public void testTupleTypes() throws Exception {
doTest("compiler/testData/renderer/TupleTypes.kt");
@@ -338,6 +338,11 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/fun"), "kt", true);
}
@TestMetadata("PropagateSubclassOfComparable.kt")
public void testPropagateSubclassOfComparable() throws Exception {
doTestSinglePackage("compiler/testData/loadKotlin/fun/PropagateSubclassOfComparable.kt");
}
@TestMetadata("compiler/testData/loadKotlin/fun/genericWithTypeVariables")
public static class GenericWithTypeVariables extends AbstractLazyResolveNamespaceComparingTest {
public void testAllFilesPresentInGenericWithTypeVariables() throws Exception {