Move possibleGetterNamesByPropertyName to FirSyntheticPropertiesScope

This commit is contained in:
Mikhail Glukhikh
2019-11-29 17:07:24 +03:00
parent d15dae6ac6
commit 5275b4d0fc
2 changed files with 20 additions and 17 deletions
@@ -14,7 +14,7 @@ import org.jetbrains.kotlin.fir.java.JavaTypeParameterStack
import org.jetbrains.kotlin.fir.java.declarations.FirJavaClass import org.jetbrains.kotlin.fir.java.declarations.FirJavaClass
import org.jetbrains.kotlin.fir.java.declarations.FirJavaMethod import org.jetbrains.kotlin.fir.java.declarations.FirJavaMethod
import org.jetbrains.kotlin.fir.java.declarations.FirJavaValueParameter import org.jetbrains.kotlin.fir.java.declarations.FirJavaValueParameter
import org.jetbrains.kotlin.fir.resolve.calls.possibleGetterNamesByPropertyName import org.jetbrains.kotlin.fir.resolve.calls.FirSyntheticPropertiesScope
import org.jetbrains.kotlin.fir.scopes.FirScope import org.jetbrains.kotlin.fir.scopes.FirScope
import org.jetbrains.kotlin.fir.scopes.ProcessorAction import org.jetbrains.kotlin.fir.scopes.ProcessorAction
import org.jetbrains.kotlin.fir.scopes.ProcessorAction.NEXT import org.jetbrains.kotlin.fir.scopes.ProcessorAction.NEXT
@@ -152,7 +152,7 @@ class JavaClassUseSiteMemberScope(
if (true) { if (true) {
return processAccessorFunctionsAndPropertiesByName(name, emptyList(), null, processor) return processAccessorFunctionsAndPropertiesByName(name, emptyList(), null, processor)
} }
val getterNames = possibleGetterNamesByPropertyName(name) val getterNames = FirSyntheticPropertiesScope.possibleGetterNamesByPropertyName(name)
val setterName = Name.identifier(SETTER_PREFIX + name.identifier.capitalize()) val setterName = Name.identifier(SETTER_PREFIX + name.identifier.capitalize())
return processAccessorFunctionsAndPropertiesByName(name, getterNames, setterName, processor) return processAccessorFunctionsAndPropertiesByName(name, getterNames, setterName, processor)
} }
@@ -66,8 +66,8 @@ class FirSyntheticPropertiesScope(
} }
return ProcessorAction.NEXT return ProcessorAction.NEXT
} }
}
companion object {
fun possibleGetterNamesByPropertyName(name: Name): List<Name> { fun possibleGetterNamesByPropertyName(name: Name): List<Name> {
if (name.isSpecial) return emptyList() if (name.isSpecial) return emptyList()
val identifier = name.identifier val identifier = name.identifier
@@ -85,3 +85,6 @@ fun possibleGetterNamesByPropertyName(name: Name): List<Name> {
private const val GETTER_PREFIX = "get" private const val GETTER_PREFIX = "get"
private const val IS_PREFIX = "is" private const val IS_PREFIX = "is"
}
}