Filter out inapplicable member scopes in resolution

This commit is contained in:
Denis Zharkov
2017-08-16 15:49:02 +07:00
parent d0bf0f5fb3
commit 860951748f
4 changed files with 22 additions and 2 deletions
@@ -78,6 +78,11 @@ abstract class DeserializedMemberScope protected constructor(
override fun getVariableNames() = variableNamesLazy
override fun getClassifierNames(): Set<Name>? = classNames + typeAliasNames
override fun definitelyDoesNotContainName(name: Name, location: LookupLocation): Boolean {
recordLookup(name, location)
return name !in functionNamesLazy && name !in variableNamesLazy && name !in classNames && name !in typeAliasNames
}
private inline fun <M : MessageLite> Collection<M>.groupByName(
getNameIndex: (M) -> Int
) = groupBy { c.nameResolver.getName(getNameIndex(it)) }