Fixed synthetic properties for method inherited from two bases

This commit is contained in:
Valentin Kipyatkov
2015-07-18 11:30:07 +03:00
parent 612c009f6b
commit 1c52f8a524
8 changed files with 79 additions and 3 deletions
@@ -110,7 +110,7 @@ class JavaSyntheticExtensionsScope(storageManager: StorageManager) : JetScope by
.asSequence()
.flatMap { memberScope.getFunctions(it).asSequence() }
.singleOrNull {
it.kind != CallableMemberDescriptor.Kind.FAKE_OVERRIDE && isGoodGetMethod(it) && it.hasJavaOriginInHierarchy()
isGoodGetMethod(it) && it.hasJavaOriginInHierarchy()
} ?: return null
// don't accept "uRL" for "getURL" etc
@@ -144,7 +144,6 @@ class JavaSyntheticExtensionsScope(storageManager: StorageManager) : JetScope by
val propertyType = getMethod.returnType ?: return false
val parameter = descriptor.valueParameters.singleOrNull() ?: return false
if (parameter.type != propertyType) {
if (descriptor.kind != CallableMemberDescriptor.Kind.FAKE_OVERRIDE) return false // real setter must exactly match getter's type
if (!propertyType.isSubtypeOf(parameter.type)) return false
if (descriptor.findOverridden {
val baseProperty = SyntheticJavaPropertyDescriptor.findByGetterOrSetter(it, this)