FIR: Do not create incorrect synthetic property

This commit is contained in:
Denis.Zharkov
2021-10-26 11:42:00 +03:00
parent 52c2908bb7
commit 0bdea4f20a
7 changed files with 48 additions and 9 deletions
@@ -146,17 +146,11 @@ class JavaSyntheticPropertiesScope(
name: Name,
ownerClass: ClassDescriptor
): SyntheticPropertyHolder {
if (name.isSpecial) return SyntheticPropertyHolder.EMPTY
val identifier = name.identifier
if (identifier.isEmpty()) return SyntheticPropertyHolder.EMPTY
val firstChar = identifier[0]
if (!firstChar.isJavaIdentifierStart() || firstChar in 'A'..'Z') return SyntheticPropertyHolder.EMPTY
val possibleGetMethodNames = possibleGetMethodNames(name)
if (possibleGetMethodNames.isEmpty()) return SyntheticPropertyHolder.EMPTY
val memberScope = ownerClass.unsubstitutedMemberScope
val possibleGetMethodNames = possibleGetMethodNames(name)
val getMethod = possibleGetMethodNames
.flatMap { memberScope.getContributedFunctions(it, NoLookupLocation.FROM_SYNTHETIC_SCOPE) }
.singleOrNull {