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
@@ -65,8 +65,15 @@ fun getPropertyNamesCandidatesByAccessorName(name: Name): List<Name> {
}
fun possibleGetMethodNames(propertyName: Name): List<Name> {
val result = ArrayList<Name>(3)
if (propertyName.isSpecial) return emptyList()
val identifier = propertyName.identifier
if (identifier.isEmpty()) return emptyList()
val firstChar = identifier[0]
if (!firstChar.isJavaIdentifierStart() || firstChar in 'A'..'Z') return emptyList()
val result = ArrayList<Name>(3)
if (JvmAbi.startsWithIsPrefix(identifier)) {
result.add(propertyName)