diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantCharAtAbstract.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantCharAtAbstract.kt new file mode 100644 index 00000000000..8462a985da9 --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantCharAtAbstract.kt @@ -0,0 +1,19 @@ +// FILE: A.java + +public abstract class A { + abstract public char charAt(int i); +} + +// FILE: B.java + +abstract public class B extends A implements CharSequence { + public char charAt(int i) { return '1'; } +} + +// FILE: main.kt + +abstract class C1 : B() + +abstract class C2 : B() { + override fun get(index: Int) = '1' +} diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantCharAtAbstract.txt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantCharAtAbstract.txt new file mode 100644 index 00000000000..aa8a8ca11d8 --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantCharAtAbstract.txt @@ -0,0 +1,39 @@ +package + +public abstract class A { + public constructor A() + public abstract fun charAt(/*0*/ i: kotlin.Int): kotlin.Char + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public abstract class B : A, kotlin.CharSequence { + public constructor B() + public abstract override /*1*/ /*fake_override*/ val length: kotlin.Int + public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*2*/ fun get(/*0*/ i: kotlin.Int): kotlin.Char + public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int + public abstract override /*1*/ /*fake_override*/ fun subSequence(/*0*/ startIndex: kotlin.Int, /*1*/ endIndex: kotlin.Int): kotlin.CharSequence + public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String +} + +public abstract class C1 : B { + public constructor C1() + public abstract override /*1*/ /*fake_override*/ val length: kotlin.Int + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun get(/*0*/ i: kotlin.Int): kotlin.Char + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public abstract override /*1*/ /*fake_override*/ fun subSequence(/*0*/ startIndex: kotlin.Int, /*1*/ endIndex: kotlin.Int): kotlin.CharSequence + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public abstract class C2 : B { + public constructor C2() + public abstract override /*1*/ /*fake_override*/ val length: kotlin.Int + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ fun get(/*0*/ index: kotlin.Int): kotlin.Char + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public abstract override /*1*/ /*fake_override*/ fun subSequence(/*0*/ startIndex: kotlin.Int, /*1*/ endIndex: kotlin.Int): kotlin.CharSequence + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantMapGetAbstract.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantMapGetAbstract.kt new file mode 100644 index 00000000000..409e6ed8c49 --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantMapGetAbstract.kt @@ -0,0 +1,19 @@ +// FILE: Dict.java + +public abstract class Dict { + abstract public V get(Object key); +} + +// FILE: MHashtable.java + +abstract public class MHashtable extends Dict implements java.util.Map { + public V get(Object key) { return null; } +} + +// FILE: main.kt + +abstract class C1 : MHashtable() + +abstract class C2 : MHashtable() { + override fun get(key: String) = 1 +} diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantMapGetAbstract.txt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantMapGetAbstract.txt new file mode 100644 index 00000000000..dc43c70ef06 --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantMapGetAbstract.txt @@ -0,0 +1,66 @@ +package + +public abstract class C1 : MHashtable { + public constructor C1() + public abstract override /*1*/ /*fake_override*/ val entries: kotlin.collections.MutableSet> + public abstract override /*1*/ /*fake_override*/ val keys: kotlin.collections.MutableSet + public abstract override /*1*/ /*fake_override*/ val size: kotlin.Int + public abstract override /*1*/ /*fake_override*/ val values: kotlin.collections.MutableCollection + public abstract override /*1*/ /*fake_override*/ fun clear(): kotlin.Unit + public abstract override /*1*/ /*fake_override*/ fun containsKey(/*0*/ key: kotlin.String!): kotlin.Boolean + public abstract override /*1*/ /*fake_override*/ fun containsValue(/*0*/ value: kotlin.Int!): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public abstract override /*1*/ /*fake_override*/ fun get(/*0*/ key: kotlin.String!): kotlin.Int? + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public abstract override /*1*/ /*fake_override*/ fun isEmpty(): kotlin.Boolean + public abstract override /*1*/ /*fake_override*/ fun put(/*0*/ key: kotlin.String!, /*1*/ value: kotlin.Int!): kotlin.Int? + public abstract override /*1*/ /*fake_override*/ fun putAll(/*0*/ from: kotlin.collections.Map): kotlin.Unit + public abstract override /*1*/ /*fake_override*/ fun remove(/*0*/ key: kotlin.String!): kotlin.Int? + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public abstract class C2 : MHashtable { + public constructor C2() + public abstract override /*1*/ /*fake_override*/ val entries: kotlin.collections.MutableSet> + public abstract override /*1*/ /*fake_override*/ val keys: kotlin.collections.MutableSet + public abstract override /*1*/ /*fake_override*/ val size: kotlin.Int + public abstract override /*1*/ /*fake_override*/ val values: kotlin.collections.MutableCollection + public abstract override /*1*/ /*fake_override*/ fun clear(): kotlin.Unit + public abstract override /*1*/ /*fake_override*/ fun containsKey(/*0*/ key: kotlin.String!): kotlin.Boolean + public abstract override /*1*/ /*fake_override*/ fun containsValue(/*0*/ value: kotlin.Int!): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ fun get(/*0*/ key: kotlin.String): kotlin.Int + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public abstract override /*1*/ /*fake_override*/ fun isEmpty(): kotlin.Boolean + public abstract override /*1*/ /*fake_override*/ fun put(/*0*/ key: kotlin.String!, /*1*/ value: kotlin.Int!): kotlin.Int? + public abstract override /*1*/ /*fake_override*/ fun putAll(/*0*/ from: kotlin.collections.Map): kotlin.Unit + public abstract override /*1*/ /*fake_override*/ fun remove(/*0*/ key: kotlin.String!): kotlin.Int? + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public abstract class Dict { + public constructor Dict() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public abstract operator fun get(/*0*/ key: kotlin.Any!): V! + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public abstract class MHashtable : Dict, kotlin.collections.MutableMap { + public constructor MHashtable() + public abstract override /*1*/ /*fake_override*/ val entries: kotlin.collections.MutableSet> + public abstract override /*1*/ /*fake_override*/ val keys: kotlin.collections.MutableSet + public abstract override /*1*/ /*fake_override*/ val size: kotlin.Int + public abstract override /*1*/ /*fake_override*/ val values: kotlin.collections.MutableCollection + public abstract override /*1*/ /*fake_override*/ fun clear(): kotlin.Unit + public abstract override /*1*/ /*fake_override*/ fun containsKey(/*0*/ key: X!): kotlin.Boolean + public abstract override /*1*/ /*fake_override*/ fun containsValue(/*0*/ value: Y!): kotlin.Boolean + public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public abstract override /*2*/ /*fake_override*/ fun get(/*0*/ key: X!): Y? + public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int + public abstract override /*1*/ /*fake_override*/ fun isEmpty(): kotlin.Boolean + public abstract override /*1*/ /*fake_override*/ fun put(/*0*/ key: X!, /*1*/ value: Y!): Y? + public abstract override /*1*/ /*fake_override*/ fun putAll(/*0*/ from: kotlin.collections.Map): kotlin.Unit + public abstract override /*1*/ /*fake_override*/ fun remove(/*0*/ key: X!): Y? + public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/testsWithJava8/specialBuiltIns/hashtableInheritance.kt b/compiler/testData/diagnostics/testsWithJava8/specialBuiltIns/hashtableInheritance.kt new file mode 100644 index 00000000000..5f57b70f762 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJava8/specialBuiltIns/hashtableInheritance.kt @@ -0,0 +1,4 @@ +class C1 : java.util.Hashtable() +class C2 : java.util.Hashtable() { + override fun get(key: String) = 123 +} diff --git a/compiler/testData/diagnostics/testsWithJava8/specialBuiltIns/hashtableInheritance.txt b/compiler/testData/diagnostics/testsWithJava8/specialBuiltIns/hashtableInheritance.txt new file mode 100644 index 00000000000..c32f9b0d7a4 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJava8/specialBuiltIns/hashtableInheritance.txt @@ -0,0 +1,99 @@ +package + +public final class C1 : java.util.Hashtable { + public constructor C1() + invisible_fake final override /*1*/ /*fake_override*/ var count: kotlin.Int + public open override /*1*/ /*fake_override*/ val entries: kotlin.collections.MutableSet> + invisible_fake final override /*1*/ /*fake_override*/ var entrySet: kotlin.collections.(Mutable)Set!>! + invisible_fake final override /*1*/ /*fake_override*/ var keySet: kotlin.collections.(Mutable)Set! + public open override /*1*/ /*fake_override*/ val keys: kotlin.collections.MutableSet + invisible_fake final override /*1*/ /*fake_override*/ var loadFactor: kotlin.Float + invisible_fake final override /*1*/ /*fake_override*/ var modCount: kotlin.Int + public open override /*1*/ /*fake_override*/ val size: kotlin.Int + invisible_fake final override /*1*/ /*fake_override*/ var table: kotlin.Array<(out) java.util.Hashtable.Entry<*, *>!>! + invisible_fake final override /*1*/ /*fake_override*/ var threshold: kotlin.Int + invisible_fake final override /*1*/ /*fake_override*/ var values: kotlin.collections.(Mutable)Collection! + public open override /*1*/ /*fake_override*/ val values: kotlin.collections.MutableCollection + invisible_fake open override /*1*/ /*fake_override*/ fun addEntry(/*0*/ p0: kotlin.Int, /*1*/ p1: kotlin.String!, /*2*/ p2: kotlin.Int!, /*3*/ p3: kotlin.Int): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun clear(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun clone(): kotlin.Any + public open override /*1*/ /*fake_override*/ fun compute(/*0*/ p0: kotlin.String!, /*1*/ p1: java.util.function.BiFunction!): kotlin.Int! + public open override /*1*/ /*fake_override*/ fun computeIfAbsent(/*0*/ p0: kotlin.String!, /*1*/ p1: java.util.function.Function!): kotlin.Int! + public open override /*1*/ /*fake_override*/ fun computeIfPresent(/*0*/ p0: kotlin.String!, /*1*/ p1: java.util.function.BiFunction!): kotlin.Int! + public open override /*1*/ /*fake_override*/ fun contains(/*0*/ p0: kotlin.Any!): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun containsKey(/*0*/ key: kotlin.String!): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun containsValue(/*0*/ value: kotlin.Int!): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun elements(): java.util.Enumeration! + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun forEach(/*0*/ p0: java.util.function.BiConsumer!): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun get(/*0*/ key: kotlin.String!): kotlin.Int? + invisible_fake open override /*1*/ /*fake_override*/ fun getEnumeration(/*0*/ p0: kotlin.Int): java.util.Enumeration! + invisible_fake open override /*1*/ /*fake_override*/ fun getIterator(/*0*/ p0: kotlin.Int): kotlin.collections.(Mutable)Iterator! + public open override /*1*/ /*fake_override*/ fun getOrDefault(/*0*/ key: kotlin.String!, /*1*/ defaultValue: kotlin.Int!): kotlin.Int! + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun isEmpty(): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun keys(): java.util.Enumeration! + public open override /*1*/ /*fake_override*/ fun merge(/*0*/ p0: kotlin.String!, /*1*/ p1: kotlin.Int!, /*2*/ p2: java.util.function.BiFunction!): kotlin.Int! + public open override /*1*/ /*fake_override*/ fun put(/*0*/ key: kotlin.String!, /*1*/ value: kotlin.Int!): kotlin.Int? + public open override /*1*/ /*fake_override*/ fun putAll(/*0*/ from: kotlin.collections.Map): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun putIfAbsent(/*0*/ p0: kotlin.String!, /*1*/ p1: kotlin.Int!): kotlin.Int! + invisible_fake open override /*1*/ /*fake_override*/ fun readObject(/*0*/ p0: java.io.ObjectInputStream!): kotlin.Unit + invisible_fake open override /*1*/ /*fake_override*/ fun reconstitutionPut(/*0*/ p0: kotlin.Array<(out) java.util.Hashtable.Entry<*, *>!>!, /*1*/ p1: kotlin.String!, /*2*/ p2: kotlin.Int!): kotlin.Unit + protected/*protected and package*/ open override /*1*/ /*fake_override*/ fun rehash(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun remove(/*0*/ key: kotlin.String!): kotlin.Int? + public open override /*1*/ /*fake_override*/ fun remove(/*0*/ key: kotlin.String!, /*1*/ value: kotlin.Int!): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun replace(/*0*/ p0: kotlin.String!, /*1*/ p1: kotlin.Int!): kotlin.Int! + public open override /*1*/ /*fake_override*/ fun replace(/*0*/ p0: kotlin.String!, /*1*/ p1: kotlin.Int!, /*2*/ p2: kotlin.Int!): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun replaceAll(/*0*/ p0: java.util.function.BiFunction!): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + invisible_fake open override /*1*/ /*fake_override*/ fun writeObject(/*0*/ p0: java.io.ObjectOutputStream!): kotlin.Unit +} + +public final class C2 : java.util.Hashtable { + public constructor C2() + invisible_fake final override /*1*/ /*fake_override*/ var count: kotlin.Int + public open override /*1*/ /*fake_override*/ val entries: kotlin.collections.MutableSet> + invisible_fake final override /*1*/ /*fake_override*/ var entrySet: kotlin.collections.(Mutable)Set!>! + invisible_fake final override /*1*/ /*fake_override*/ var keySet: kotlin.collections.(Mutable)Set! + public open override /*1*/ /*fake_override*/ val keys: kotlin.collections.MutableSet + invisible_fake final override /*1*/ /*fake_override*/ var loadFactor: kotlin.Float + invisible_fake final override /*1*/ /*fake_override*/ var modCount: kotlin.Int + public open override /*1*/ /*fake_override*/ val size: kotlin.Int + invisible_fake final override /*1*/ /*fake_override*/ var table: kotlin.Array<(out) java.util.Hashtable.Entry<*, *>!>! + invisible_fake final override /*1*/ /*fake_override*/ var threshold: kotlin.Int + invisible_fake final override /*1*/ /*fake_override*/ var values: kotlin.collections.(Mutable)Collection! + public open override /*1*/ /*fake_override*/ val values: kotlin.collections.MutableCollection + invisible_fake open override /*1*/ /*fake_override*/ fun addEntry(/*0*/ p0: kotlin.Int, /*1*/ p1: kotlin.String!, /*2*/ p2: kotlin.Int!, /*3*/ p3: kotlin.Int): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun clear(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun clone(): kotlin.Any + public open override /*1*/ /*fake_override*/ fun compute(/*0*/ p0: kotlin.String!, /*1*/ p1: java.util.function.BiFunction!): kotlin.Int! + public open override /*1*/ /*fake_override*/ fun computeIfAbsent(/*0*/ p0: kotlin.String!, /*1*/ p1: java.util.function.Function!): kotlin.Int! + public open override /*1*/ /*fake_override*/ fun computeIfPresent(/*0*/ p0: kotlin.String!, /*1*/ p1: java.util.function.BiFunction!): kotlin.Int! + public open override /*1*/ /*fake_override*/ fun contains(/*0*/ p0: kotlin.Any!): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun containsKey(/*0*/ key: kotlin.String!): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun containsValue(/*0*/ value: kotlin.Int!): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun elements(): java.util.Enumeration! + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun forEach(/*0*/ p0: java.util.function.BiConsumer!): kotlin.Unit + public open override /*1*/ fun get(/*0*/ key: kotlin.String): kotlin.Int + invisible_fake open override /*1*/ /*fake_override*/ fun getEnumeration(/*0*/ p0: kotlin.Int): java.util.Enumeration! + invisible_fake open override /*1*/ /*fake_override*/ fun getIterator(/*0*/ p0: kotlin.Int): kotlin.collections.(Mutable)Iterator! + public open override /*1*/ /*fake_override*/ fun getOrDefault(/*0*/ key: kotlin.String!, /*1*/ defaultValue: kotlin.Int!): kotlin.Int! + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun isEmpty(): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun keys(): java.util.Enumeration! + public open override /*1*/ /*fake_override*/ fun merge(/*0*/ p0: kotlin.String!, /*1*/ p1: kotlin.Int!, /*2*/ p2: java.util.function.BiFunction!): kotlin.Int! + public open override /*1*/ /*fake_override*/ fun put(/*0*/ key: kotlin.String!, /*1*/ value: kotlin.Int!): kotlin.Int? + public open override /*1*/ /*fake_override*/ fun putAll(/*0*/ from: kotlin.collections.Map): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun putIfAbsent(/*0*/ p0: kotlin.String!, /*1*/ p1: kotlin.Int!): kotlin.Int! + invisible_fake open override /*1*/ /*fake_override*/ fun readObject(/*0*/ p0: java.io.ObjectInputStream!): kotlin.Unit + invisible_fake open override /*1*/ /*fake_override*/ fun reconstitutionPut(/*0*/ p0: kotlin.Array<(out) java.util.Hashtable.Entry<*, *>!>!, /*1*/ p1: kotlin.String!, /*2*/ p2: kotlin.Int!): kotlin.Unit + protected/*protected and package*/ open override /*1*/ /*fake_override*/ fun rehash(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun remove(/*0*/ key: kotlin.String!): kotlin.Int? + public open override /*1*/ /*fake_override*/ fun remove(/*0*/ key: kotlin.String!, /*1*/ value: kotlin.Int!): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun replace(/*0*/ p0: kotlin.String!, /*1*/ p1: kotlin.Int!): kotlin.Int! + public open override /*1*/ /*fake_override*/ fun replace(/*0*/ p0: kotlin.String!, /*1*/ p1: kotlin.Int!, /*2*/ p2: kotlin.Int!): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun replaceAll(/*0*/ p0: java.util.function.BiFunction!): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + invisible_fake open override /*1*/ /*fake_override*/ fun writeObject(/*0*/ p0: java.io.ObjectOutputStream!): kotlin.Unit +} diff --git a/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/DiagnosticsWithJava8TestGenerated.java b/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/DiagnosticsWithJava8TestGenerated.java index 64f1664d095..8974117c2ee 100644 --- a/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/DiagnosticsWithJava8TestGenerated.java +++ b/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/DiagnosticsWithJava8TestGenerated.java @@ -98,6 +98,21 @@ public class DiagnosticsWithJava8TestGenerated extends AbstractDiagnosticsWithFu } } + @TestMetadata("compiler/testData/diagnostics/testsWithJava8/specialBuiltIns") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class SpecialBuiltIns extends AbstractDiagnosticsWithFullJdkTest { + public void testAllFilesPresentInSpecialBuiltIns() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithJava8/specialBuiltIns"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("hashtableInheritance.kt") + public void testHashtableInheritance() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJava8/specialBuiltIns/hashtableInheritance.kt"); + doTest(fileName); + } + } + @TestMetadata("compiler/testData/diagnostics/testsWithJava8/statics") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index bf63da39162..fc9cab64dbe 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -11216,6 +11216,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { doTest(fileName); } + @TestMetadata("irrelevantCharAtAbstract.kt") + public void testIrrelevantCharAtAbstract() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantCharAtAbstract.kt"); + doTest(fileName); + } + @TestMetadata("irrelevantImplCharSequence.kt") public void testIrrelevantImplCharSequence() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequence.kt"); @@ -11240,6 +11246,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { doTest(fileName); } + @TestMetadata("irrelevantMapGetAbstract.kt") + public void testIrrelevantMapGetAbstract() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantMapGetAbstract.kt"); + doTest(fileName); + } + @TestMetadata("mapGetOverride.kt") public void testMapGetOverride() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/collectionOverrides/mapGetOverride.kt"); diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt index eae7cbcee4a..c84dd201494 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt @@ -346,7 +346,7 @@ class LazyJavaClassMemberScope( specialBuiltin: CallableDescriptor, alreadyDeclaredFunctions: Collection ): SimpleFunctionDescriptor = - if (alreadyDeclaredFunctions.none { this != it && it.doesOverride(specialBuiltin) }) + if (alreadyDeclaredFunctions.none { this != it && it.initialSignatureDescriptor == null && it.doesOverride(specialBuiltin) }) this else newCopyBuilder().setHiddenToOvercomeSignatureClash().build()!!