From 13849f6b6e22a137a6cee304f33ba9917e5f67ad Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Fri, 12 Jul 2013 18:35:34 +0400 Subject: [PATCH] Choosing most specific super member when building fake override. Previously, random one was chosen. --- .../jet/lang/resolve/OverrideResolver.java | 40 +++++++++++++++++-- compiler/testData/builtin-classes.txt | 2 +- .../compiledJava/sam/SamSubinterfaceOfTwo.txt | 2 +- .../InheritMethodsDifferentReturnTypes.java | 16 ++++++++ .../InheritMethodsDifferentReturnTypes.kt | 16 ++++++++ .../InheritMethodsDifferentReturnTypes.txt | 20 ++++++++++ ...ritMethodsDifferentReturnTypesGeneric.java | 16 ++++++++ ...heritMethodsDifferentReturnTypesGeneric.kt | 16 ++++++++ ...eritMethodsDifferentReturnTypesGeneric.txt | 20 ++++++++++ .../return/HalfSubstitutedTypeParameters.txt | 2 +- .../modality/ModalityOfFakeOverrides.txt | 12 +++--- ...hodsDifferentReturnTypesAndVisibilities.kt | 14 +++++++ ...odsDifferentReturnTypesAndVisibilities.txt | 16 ++++++++ .../loadKotlin/fun/InheritValAndVar.kt | 14 +++++++ .../loadKotlin/fun/InheritValAndVar.txt | 26 ++++++++++++ .../fun/InheritValsDifferentTypes.kt | 14 +++++++ .../fun/InheritValsDifferentTypes.txt | 22 ++++++++++ .../LoadCompiledKotlinTestGenerated.java | 15 +++++++ .../jvm/compiler/LoadJavaTestGenerated.java | 10 +++++ ...esolveNamespaceComparingTestGenerated.java | 25 ++++++++++++ 20 files changed, 306 insertions(+), 12 deletions(-) create mode 100644 compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypes.java create mode 100644 compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypes.kt create mode 100644 compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypes.txt create mode 100644 compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypesGeneric.java create mode 100644 compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypesGeneric.kt create mode 100644 compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypesGeneric.txt create mode 100644 compiler/testData/loadKotlin/fun/InheritMethodsDifferentReturnTypesAndVisibilities.kt create mode 100644 compiler/testData/loadKotlin/fun/InheritMethodsDifferentReturnTypesAndVisibilities.txt create mode 100644 compiler/testData/loadKotlin/fun/InheritValAndVar.kt create mode 100644 compiler/testData/loadKotlin/fun/InheritValAndVar.txt create mode 100644 compiler/testData/loadKotlin/fun/InheritValsDifferentTypes.kt create mode 100644 compiler/testData/loadKotlin/fun/InheritValsDifferentTypes.txt diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/OverrideResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/OverrideResolver.java index 1a88347c6c5..62afee312e0 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/OverrideResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/OverrideResolver.java @@ -243,12 +243,45 @@ public class OverrideResolver { while (!fromSuperQueue.isEmpty()) { CallableMemberDescriptor notOverriddenFromSuper = VisibilityUtil.findMemberWithMaxVisibility(fromSuperQueue); Collection overridables = extractMembersOverridableBy(notOverriddenFromSuper, fromSuperQueue, sink); - createAndBindFakeOverride(notOverriddenFromSuper, overridables, current, sink); + createAndBindFakeOverride(overridables, current, sink); } } + private static boolean isMoreSpecific(@NotNull CallableMemberDescriptor a, @NotNull CallableMemberDescriptor b) { + if (a instanceof SimpleFunctionDescriptor) { + assert b instanceof SimpleFunctionDescriptor : "b is " + b.getClass(); + + JetType aReturnType = a.getReturnType(); + assert aReturnType != null; + JetType bReturnType = b.getReturnType(); + assert bReturnType != null; + + return JetTypeChecker.INSTANCE.isSubtypeOf(aReturnType, bReturnType); + } + if (a instanceof PropertyDescriptor) { + assert b instanceof PropertyDescriptor : "b is " + b.getClass(); + + if (((PropertyDescriptor) a).isVar() || ((PropertyDescriptor) b).isVar()) { + return ((PropertyDescriptor) a).isVar(); + } + + // both vals + return JetTypeChecker.INSTANCE.isSubtypeOf(((PropertyDescriptor) a).getType(), ((PropertyDescriptor) b).getType()); + } + throw new IllegalArgumentException("Unexpected callable: " + a.getClass()); + } + + private static CallableMemberDescriptor selectMostSpecificMemberFromSuper(@NotNull Collection overridables) { + CallableMemberDescriptor result = null; + for (CallableMemberDescriptor overridable : overridables) { + if (result == null || isMoreSpecific(overridable, result)) { + result = overridable; + } + } + return result; + } + private static void createAndBindFakeOverride( - @NotNull CallableMemberDescriptor notOverriddenFromSuper, @NotNull Collection overridables, @NotNull ClassDescriptor current, @NotNull DescriptorSink sink @@ -258,8 +291,9 @@ public class OverrideResolver { boolean allInvisible = visibleOverridables.isEmpty(); Collection effectiveOverridden = allInvisible ? overridables : visibleOverridables; Visibility visibility = allInvisible ? Visibilities.INVISIBLE_FAKE : Visibilities.INHERITED; + CallableMemberDescriptor mostSpecific = selectMostSpecificMemberFromSuper(effectiveOverridden); CallableMemberDescriptor fakeOverride = - notOverriddenFromSuper.copy(current, modality, visibility, CallableMemberDescriptor.Kind.FAKE_OVERRIDE, false); + mostSpecific.copy(current, modality, visibility, CallableMemberDescriptor.Kind.FAKE_OVERRIDE, false); for (CallableMemberDescriptor descriptor : effectiveOverridden) { OverridingUtil.bindOverride(fakeOverride, descriptor); } diff --git a/compiler/testData/builtin-classes.txt b/compiler/testData/builtin-classes.txt index 1082314e80a..d06a3f528ac 100644 --- a/compiler/testData/builtin-classes.txt +++ b/compiler/testData/builtin-classes.txt @@ -1323,7 +1323,7 @@ public trait MutableList : jet.List, jet.MutableCollection { public abstract override /*2*/ /*fake_override*/ fun hashCode(): jet.Int public abstract override /*1*/ /*fake_override*/ fun indexOf(/*0*/ o: jet.Any?): jet.Int public abstract override /*2*/ /*fake_override*/ fun isEmpty(): jet.Boolean - public abstract override /*2*/ /*fake_override*/ fun iterator(): jet.Iterator + public abstract override /*2*/ /*fake_override*/ fun iterator(): jet.MutableIterator public abstract override /*1*/ /*fake_override*/ fun lastIndexOf(/*0*/ o: jet.Any?): jet.Int public abstract override /*1*/ fun listIterator(): jet.MutableListIterator public abstract override /*1*/ fun listIterator(/*0*/ index: jet.Int): jet.MutableListIterator diff --git a/compiler/testData/loadJava/compiledJava/sam/SamSubinterfaceOfTwo.txt b/compiler/testData/loadJava/compiledJava/sam/SamSubinterfaceOfTwo.txt index 07f65c706d7..0d55aad0e86 100644 --- a/compiler/testData/loadJava/compiledJava/sam/SamSubinterfaceOfTwo.txt +++ b/compiler/testData/loadJava/compiledJava/sam/SamSubinterfaceOfTwo.txt @@ -3,7 +3,7 @@ package test public trait SamSubinterfaceOfTwo : java.lang.Object { public trait Sub : test.SamSubinterfaceOfTwo.Super1, test.SamSubinterfaceOfTwo.Super2 { - public abstract override /*2*/ /*fake_override*/ fun f(): jet.CharSequence? + public abstract override /*2*/ /*fake_override*/ fun f(): jet.String? } public trait Super1 : java.lang.Object { diff --git a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypes.java b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypes.java new file mode 100644 index 00000000000..0282290e82b --- /dev/null +++ b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypes.java @@ -0,0 +1,16 @@ +package test; + +public final class InheritMethodsDifferentReturnTypes { + public interface Super1 { + CharSequence foo(); + String bar(); + } + + public interface Super2 { + String foo(); + CharSequence bar(); + } + + public interface Sub extends Super1, Super2 { + } +} diff --git a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypes.kt b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypes.kt new file mode 100644 index 00000000000..e291a385068 --- /dev/null +++ b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypes.kt @@ -0,0 +1,16 @@ +package test + +public class InheritMethodsDifferentReturnTypes: Object() { + public trait Super1: Object { + public fun foo(): CharSequence? + public fun bar(): String? + } + + public trait Super2: Object { + public fun foo(): String? + public fun bar(): CharSequence? + } + + public trait Sub: Super1, Super2 { + } +} diff --git a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypes.txt b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypes.txt new file mode 100644 index 00000000000..a885a84160d --- /dev/null +++ b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypes.txt @@ -0,0 +1,20 @@ +package test + +public final class InheritMethodsDifferentReturnTypes : java.lang.Object { + public constructor InheritMethodsDifferentReturnTypes() + + public trait Sub : test.InheritMethodsDifferentReturnTypes.Super1, test.InheritMethodsDifferentReturnTypes.Super2 { + public abstract override /*2*/ /*fake_override*/ fun bar(): jet.String? + public abstract override /*2*/ /*fake_override*/ fun foo(): jet.String? + } + + public trait Super1 : java.lang.Object { + public abstract fun bar(): jet.String? + public abstract fun foo(): jet.CharSequence? + } + + public trait Super2 : java.lang.Object { + public abstract fun bar(): jet.CharSequence? + public abstract fun foo(): jet.String? + } +} diff --git a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypesGeneric.java b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypesGeneric.java new file mode 100644 index 00000000000..8f302a9ee9e --- /dev/null +++ b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypesGeneric.java @@ -0,0 +1,16 @@ +package test; + +public final class InheritMethodsDifferentReturnTypesGeneric { + public interface Super1 { + F foo(); + B bar(); + } + + public interface Super2 { + FF foo(); + BB bar(); + } + + public interface Sub extends Super1, Super2 { + } +} diff --git a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypesGeneric.kt b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypesGeneric.kt new file mode 100644 index 00000000000..4d5f479f891 --- /dev/null +++ b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypesGeneric.kt @@ -0,0 +1,16 @@ +package test + +public class InheritMethodsDifferentReturnTypesGeneric: Object() { + public trait Super1: Object { + public fun foo(): F? + public fun bar(): B? + } + + public trait Super2: Object { + public fun foo(): FF? + public fun bar(): BB? + } + + public trait Sub: Super1, Super2 { + } +} diff --git a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypesGeneric.txt b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypesGeneric.txt new file mode 100644 index 00000000000..d4bb464002c --- /dev/null +++ b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypesGeneric.txt @@ -0,0 +1,20 @@ +package test + +public final class InheritMethodsDifferentReturnTypesGeneric : java.lang.Object { + public constructor InheritMethodsDifferentReturnTypesGeneric() + + public trait Sub : test.InheritMethodsDifferentReturnTypesGeneric.Super1, test.InheritMethodsDifferentReturnTypesGeneric.Super2 { + public abstract override /*2*/ /*fake_override*/ fun bar(): jet.String? + public abstract override /*2*/ /*fake_override*/ fun foo(): jet.String? + } + + public trait Super1 : java.lang.Object { + public abstract fun bar(): B? + public abstract fun foo(): F? + } + + public trait Super2 : java.lang.Object { + public abstract fun bar(): BB? + public abstract fun foo(): FF? + } +} diff --git a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/kotlinSignature/propagation/return/HalfSubstitutedTypeParameters.txt b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/kotlinSignature/propagation/return/HalfSubstitutedTypeParameters.txt index b94568c8ca3..8a4cc197422 100644 --- a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/kotlinSignature/propagation/return/HalfSubstitutedTypeParameters.txt +++ b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/kotlinSignature/propagation/return/HalfSubstitutedTypeParameters.txt @@ -23,7 +23,7 @@ public trait HalfSubstitutedTypeParameters : java.lang.Object { public abstract override /*1*/ /*fake_override*/ fun get(/*0*/ index: jet.Int): E public abstract override /*1*/ /*fake_override*/ fun indexOf(/*0*/ o: jet.Any?): jet.Int public abstract override /*1*/ /*fake_override*/ fun isEmpty(): jet.Boolean - public abstract override /*1*/ /*fake_override*/ fun iterator(): jet.Iterator + public abstract override /*1*/ /*fake_override*/ fun iterator(): jet.MutableIterator public abstract override /*1*/ /*fake_override*/ fun lastIndexOf(/*0*/ o: jet.Any?): jet.Int public abstract override /*1*/ /*fake_override*/ fun listIterator(): jet.MutableListIterator public abstract override /*1*/ /*fake_override*/ fun listIterator(/*0*/ index: jet.Int): jet.MutableListIterator diff --git a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/modality/ModalityOfFakeOverrides.txt b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/modality/ModalityOfFakeOverrides.txt index 01ae4e35e02..624c700c37f 100644 --- a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/modality/ModalityOfFakeOverrides.txt +++ b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/modality/ModalityOfFakeOverrides.txt @@ -5,11 +5,11 @@ public open class ModalityOfFakeOverrides : java.util.AbstractList { protected final override /*1*/ /*fake_override*/ var modCount: jet.Int public open override /*1*/ /*fake_override*/ fun add(/*0*/ p0: jet.Int, /*1*/ p1: jet.String): jet.Unit public open override /*1*/ /*fake_override*/ fun add(/*0*/ p0: jet.String): jet.Boolean - public open override /*1*/ /*fake_override*/ fun addAll(/*0*/ p0: jet.Collection): jet.Boolean + public open override /*1*/ /*fake_override*/ fun addAll(/*0*/ c: jet.Collection): jet.Boolean public open override /*1*/ /*fake_override*/ fun addAll(/*0*/ p0: jet.Int, /*1*/ p1: jet.Collection): jet.Boolean public open override /*1*/ /*fake_override*/ fun clear(): jet.Unit - public open override /*1*/ /*fake_override*/ fun contains(/*0*/ p0: jet.Any?): jet.Boolean - public open override /*1*/ /*fake_override*/ fun containsAll(/*0*/ p0: jet.Collection): jet.Boolean + public open override /*1*/ /*fake_override*/ fun contains(/*0*/ o: jet.Any?): jet.Boolean + public open override /*1*/ /*fake_override*/ fun containsAll(/*0*/ c: jet.Collection): jet.Boolean public open override /*1*/ fun get(/*0*/ p0: jet.Int): jet.String public open override /*1*/ /*fake_override*/ fun indexOf(/*0*/ p0: jet.Any?): jet.Int public open override /*1*/ /*fake_override*/ fun isEmpty(): jet.Boolean @@ -17,11 +17,11 @@ public open class ModalityOfFakeOverrides : java.util.AbstractList { public open override /*1*/ /*fake_override*/ fun lastIndexOf(/*0*/ p0: jet.Any?): jet.Int public open override /*1*/ /*fake_override*/ fun listIterator(): jet.MutableListIterator public open override /*1*/ /*fake_override*/ fun listIterator(/*0*/ p0: jet.Int): jet.MutableListIterator - public open override /*1*/ /*fake_override*/ fun remove(/*0*/ p0: jet.Any?): jet.Boolean + public open override /*1*/ /*fake_override*/ fun remove(/*0*/ o: jet.Any?): jet.Boolean public open override /*1*/ /*fake_override*/ fun remove(/*0*/ p0: jet.Int): jet.String - public open override /*1*/ /*fake_override*/ fun removeAll(/*0*/ p0: jet.Collection): jet.Boolean + public open override /*1*/ /*fake_override*/ fun removeAll(/*0*/ c: jet.Collection): jet.Boolean protected open override /*1*/ /*fake_override*/ fun removeRange(/*0*/ p0: jet.Int, /*1*/ p1: jet.Int): jet.Unit - public open override /*1*/ /*fake_override*/ fun retainAll(/*0*/ p0: jet.Collection): jet.Boolean + public open override /*1*/ /*fake_override*/ fun retainAll(/*0*/ c: jet.Collection): jet.Boolean public open override /*1*/ /*fake_override*/ fun set(/*0*/ p0: jet.Int, /*1*/ p1: jet.String): jet.String public open override /*1*/ fun size(): jet.Int public open override /*1*/ /*fake_override*/ fun subList(/*0*/ p0: jet.Int, /*1*/ p1: jet.Int): jet.MutableList diff --git a/compiler/testData/loadKotlin/fun/InheritMethodsDifferentReturnTypesAndVisibilities.kt b/compiler/testData/loadKotlin/fun/InheritMethodsDifferentReturnTypesAndVisibilities.kt new file mode 100644 index 00000000000..22f48cf32c6 --- /dev/null +++ b/compiler/testData/loadKotlin/fun/InheritMethodsDifferentReturnTypesAndVisibilities.kt @@ -0,0 +1,14 @@ +package test + +public trait Super1 { + public fun foo(): CharSequence + private fun bar(): String +} + +public trait Super2 { + private fun foo(): String + public fun bar(): CharSequence +} + +public trait Sub: Super1, Super2 { +} diff --git a/compiler/testData/loadKotlin/fun/InheritMethodsDifferentReturnTypesAndVisibilities.txt b/compiler/testData/loadKotlin/fun/InheritMethodsDifferentReturnTypesAndVisibilities.txt new file mode 100644 index 00000000000..d5ce427d1c6 --- /dev/null +++ b/compiler/testData/loadKotlin/fun/InheritMethodsDifferentReturnTypesAndVisibilities.txt @@ -0,0 +1,16 @@ +package test + +public trait Sub : test.Super1, test.Super2 { + public abstract override /*1*/ /*fake_override*/ fun bar(): jet.CharSequence + public abstract override /*1*/ /*fake_override*/ fun foo(): jet.CharSequence +} + +public trait Super1 { + private abstract fun bar(): jet.String + public abstract fun foo(): jet.CharSequence +} + +public trait Super2 { + public abstract fun bar(): jet.CharSequence + private abstract fun foo(): jet.String +} diff --git a/compiler/testData/loadKotlin/fun/InheritValAndVar.kt b/compiler/testData/loadKotlin/fun/InheritValAndVar.kt new file mode 100644 index 00000000000..da7b91104bb --- /dev/null +++ b/compiler/testData/loadKotlin/fun/InheritValAndVar.kt @@ -0,0 +1,14 @@ +package test + +public trait Super1 { + val x: String + var y: String +} + +public trait Super2 { + var x: String + val y: String +} + +public trait Sub: Super1, Super2 { +} diff --git a/compiler/testData/loadKotlin/fun/InheritValAndVar.txt b/compiler/testData/loadKotlin/fun/InheritValAndVar.txt new file mode 100644 index 00000000000..917b4b8cd2e --- /dev/null +++ b/compiler/testData/loadKotlin/fun/InheritValAndVar.txt @@ -0,0 +1,26 @@ +package test + +public trait Sub : test.Super1, test.Super2 { + internal abstract override /*2*/ /*fake_override*/ var x: jet.String + internal abstract override /*2*/ /*fake_override*/ fun (): jet.String + internal abstract override /*1*/ /*fake_override*/ fun (/*0*/ : jet.String): jet.Unit + internal abstract override /*2*/ /*fake_override*/ var y: jet.String + internal abstract override /*2*/ /*fake_override*/ fun (): jet.String + internal abstract override /*1*/ /*fake_override*/ fun (/*0*/ : jet.String): jet.Unit +} + +public trait Super1 { + internal abstract val x: jet.String + internal abstract fun (): jet.String + internal abstract var y: jet.String + internal abstract fun (): jet.String + internal abstract fun (/*0*/ : jet.String): jet.Unit +} + +public trait Super2 { + internal abstract var x: jet.String + internal abstract fun (): jet.String + internal abstract fun (/*0*/ : jet.String): jet.Unit + internal abstract val y: jet.String + internal abstract fun (): jet.String +} diff --git a/compiler/testData/loadKotlin/fun/InheritValsDifferentTypes.kt b/compiler/testData/loadKotlin/fun/InheritValsDifferentTypes.kt new file mode 100644 index 00000000000..63759c05d2e --- /dev/null +++ b/compiler/testData/loadKotlin/fun/InheritValsDifferentTypes.kt @@ -0,0 +1,14 @@ +package test + +public trait Super1 { + val x: String + val y: CharSequence +} + +public trait Super2 { + val x: CharSequence + val y: String +} + +public trait Sub: Super1, Super2 { +} diff --git a/compiler/testData/loadKotlin/fun/InheritValsDifferentTypes.txt b/compiler/testData/loadKotlin/fun/InheritValsDifferentTypes.txt new file mode 100644 index 00000000000..40caba49eba --- /dev/null +++ b/compiler/testData/loadKotlin/fun/InheritValsDifferentTypes.txt @@ -0,0 +1,22 @@ +package test + +public trait Sub : test.Super1, test.Super2 { + internal abstract override /*2*/ /*fake_override*/ val x: jet.String + internal abstract override /*2*/ /*fake_override*/ fun (): jet.String + internal abstract override /*2*/ /*fake_override*/ val y: jet.String + internal abstract override /*2*/ /*fake_override*/ fun (): jet.String +} + +public trait Super1 { + internal abstract val x: jet.String + internal abstract fun (): jet.String + internal abstract val y: jet.CharSequence + internal abstract fun (): jet.CharSequence +} + +public trait Super2 { + internal abstract val x: jet.CharSequence + internal abstract fun (): jet.CharSequence + internal abstract val y: jet.String + internal abstract fun (): jet.String +} diff --git a/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java b/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java index 5a3b33e8e68..4416d106319 100644 --- a/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java @@ -444,6 +444,21 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/fun"), Pattern.compile("^(.+)\\.kt$"), true); } + @TestMetadata("InheritMethodsDifferentReturnTypesAndVisibilities.kt") + public void testInheritMethodsDifferentReturnTypesAndVisibilities() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/fun/InheritMethodsDifferentReturnTypesAndVisibilities.kt"); + } + + @TestMetadata("InheritValAndVar.kt") + public void testInheritValAndVar() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/fun/InheritValAndVar.kt"); + } + + @TestMetadata("InheritValsDifferentTypes.kt") + public void testInheritValsDifferentTypes() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/fun/InheritValsDifferentTypes.kt"); + } + @TestMetadata("NoSamAdapter.kt") public void testNoSamAdapter() throws Exception { doTestWithAccessors("compiler/testData/loadKotlin/fun/NoSamAdapter.kt"); diff --git a/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadJavaTestGenerated.java b/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadJavaTestGenerated.java index b9680c61ef3..a67c4de380f 100644 --- a/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadJavaTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadJavaTestGenerated.java @@ -94,6 +94,16 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest { doTest("compiler/testData/loadJava/compiledJavaCompareWithKotlin/FinalFieldAsVal.java"); } + @TestMetadata("InheritMethodsDifferentReturnTypes.java") + public void testInheritMethodsDifferentReturnTypes() throws Exception { + doTest("compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypes.java"); + } + + @TestMetadata("InheritMethodsDifferentReturnTypesGeneric.java") + public void testInheritMethodsDifferentReturnTypesGeneric() throws Exception { + doTest("compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypesGeneric.java"); + } + @TestMetadata("InnerClass.java") public void testInnerClass() throws Exception { doTest("compiler/testData/loadJava/compiledJavaCompareWithKotlin/InnerClass.java"); diff --git a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveNamespaceComparingTestGenerated.java b/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveNamespaceComparingTestGenerated.java index 4e5a10b0deb..4eb05ca9dc4 100644 --- a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveNamespaceComparingTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveNamespaceComparingTestGenerated.java @@ -446,6 +446,21 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/fun"), Pattern.compile("^(.+)\\.kt$"), true); } + @TestMetadata("InheritMethodsDifferentReturnTypesAndVisibilities.kt") + public void testInheritMethodsDifferentReturnTypesAndVisibilities() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/InheritMethodsDifferentReturnTypesAndVisibilities.kt"); + } + + @TestMetadata("InheritValAndVar.kt") + public void testInheritValAndVar() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/InheritValAndVar.kt"); + } + + @TestMetadata("InheritValsDifferentTypes.kt") + public void testInheritValsDifferentTypes() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/InheritValsDifferentTypes.kt"); + } + @TestMetadata("NoSamAdapter.kt") public void testNoSamAdapter() throws Exception { doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/NoSamAdapter.kt"); @@ -1186,6 +1201,16 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso doTestNotCheckingPrimaryConstructors("compiler/testData/loadJava/compiledJavaCompareWithKotlin/FinalFieldAsVal.kt"); } + @TestMetadata("InheritMethodsDifferentReturnTypes.kt") + public void testInheritMethodsDifferentReturnTypes() throws Exception { + doTestNotCheckingPrimaryConstructors("compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypes.kt"); + } + + @TestMetadata("InheritMethodsDifferentReturnTypesGeneric.kt") + public void testInheritMethodsDifferentReturnTypesGeneric() throws Exception { + doTestNotCheckingPrimaryConstructors("compiler/testData/loadJava/compiledJavaCompareWithKotlin/InheritMethodsDifferentReturnTypesGeneric.kt"); + } + @TestMetadata("InnerClass.kt") public void testInnerClass() throws Exception { doTestNotCheckingPrimaryConstructors("compiler/testData/loadJava/compiledJavaCompareWithKotlin/InnerClass.kt");