diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticExtensionsScope.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticExtensionsScope.kt index eb097c037e3..1f756442c03 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticExtensionsScope.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticExtensionsScope.kt @@ -109,13 +109,14 @@ class JavaSyntheticExtensionsScope(storageManager: StorageManager) : JetScope by val getMethod = possibleGetMethodNames(name) .asSequence() .flatMap { memberScope.getFunctions(it).asSequence() } - .singleOrNull { isGoodGetMethod(it) } ?: return null + .singleOrNull { it.kind != CallableMemberDescriptor.Kind.FAKE_OVERRIDE && isGoodGetMethod(it) } ?: return null // don't accept "uRL" for "getURL" etc if (SyntheticJavaPropertyDescriptor.propertyNameByGetMethodName(getMethod.name) != name) return null val propertyType = getMethod.getReturnType() ?: return null - val setMethod = memberScope.getFunctions(setMethodName(getMethod.getName())).singleOrNull { isGoodSetMethod(it, propertyType) } + val setMethod = memberScope.getFunctions(setMethodName(getMethod.getName())) + .singleOrNull { it.kind != CallableMemberDescriptor.Kind.FAKE_OVERRIDE && isGoodSetMethod(it, propertyType) } return MyPropertyDescriptor(javaClass, getMethod.original, setMethod?.original, name, propertyType) } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/Bases.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/Bases.kt index 1b924922c87..2ea41e308b1 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/Bases.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/Bases.kt @@ -1,10 +1,10 @@ // FILE: KotlinFile.kt open class KotlinClass1 : JavaClass1() { - fun getSomethingKotlin1(): Int = 1 + public fun getSomethingKotlin1(): Int = 1 } class KotlinClass2 : JavaClass2() { - fun getSomethingKotlin2(): Int = 1 + public fun getSomethingKotlin2(): Int = 1 } fun foo(k: KotlinClass2) { diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/Bases.txt b/compiler/testData/diagnostics/tests/syntheticExtensions/Bases.txt index 51a80c0f2d6..2681c9cc870 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/Bases.txt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/Bases.txt @@ -16,7 +16,7 @@ public open class JavaClass2 : KotlinClass1 { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun getSomething1(): kotlin.Int public open fun getSomething2(): kotlin.Int - internal final override /*1*/ /*fake_override*/ fun getSomethingKotlin1(): kotlin.Int + public final override /*1*/ /*fake_override*/ fun getSomethingKotlin1(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -25,7 +25,7 @@ internal open class KotlinClass1 : JavaClass1 { public constructor KotlinClass1() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun getSomething1(): kotlin.Int - internal final fun getSomethingKotlin1(): kotlin.Int + public final fun getSomethingKotlin1(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -35,8 +35,8 @@ internal final class KotlinClass2 : JavaClass2 { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun getSomething1(): kotlin.Int public open override /*1*/ /*fake_override*/ fun getSomething2(): kotlin.Int - internal final override /*1*/ /*fake_override*/ fun getSomethingKotlin1(): kotlin.Int - internal final fun getSomethingKotlin2(): kotlin.Int + public final override /*1*/ /*fake_override*/ fun getSomethingKotlin1(): kotlin.Int + public final fun getSomethingKotlin2(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/Getter.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/Getter.kt index 27eb7ad4cb2..314f895def1 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/Getter.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/Getter.kt @@ -1,6 +1,6 @@ // FILE: KotlinFile.kt class KotlinClass { - fun getSomething(): Int = 1 + public fun getSomething(): Int = 1 } fun foo(javaClass: JavaClass, kotlinClass: KotlinClass) { diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/Getter.txt b/compiler/testData/diagnostics/tests/syntheticExtensions/Getter.txt index 73feaeb7466..f82412dce00 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/Getter.txt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/Getter.txt @@ -14,7 +14,7 @@ public open class JavaClass { internal final class KotlinClass { public constructor KotlinClass() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final fun getSomething(): kotlin.Int + public final fun getSomething(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String }