Added JetScope.getSyntheticExtensionFunctions()

This commit is contained in:
Valentin Kipyatkov
2015-07-27 19:43:02 +03:00
parent 456cdab814
commit ece4d8b82f
9 changed files with 51 additions and 10 deletions
@@ -58,6 +58,10 @@ class AllUnderImportsScope : JetScope {
return scopes.flatMap { it.getSyntheticExtensionProperties(receiverTypes, name) }
}
override fun getSyntheticExtensionFunctions(receiverTypes: Collection<JetType>, name: Name): Collection<FunctionDescriptor> {
return scopes.flatMap { it.getSyntheticExtensionFunctions(receiverTypes, name) }
}
override fun getSyntheticExtensionProperties(receiverTypes: Collection<JetType>): Collection<PropertyDescriptor> {
return scopes.flatMap { it.getSyntheticExtensionProperties(receiverTypes) }
}
@@ -263,6 +263,11 @@ class LazyImportScope(
return importResolver.collectFromImports(name, LookupMode.EVERYTHING) { scope, name -> scope.getSyntheticExtensionProperties(receiverTypes, name) }
}
override fun getSyntheticExtensionFunctions(receiverTypes: Collection<JetType>, name: Name): Collection<FunctionDescriptor> {
if (filteringKind == FilteringKind.INVISIBLE_CLASSES) return listOf()
return importResolver.collectFromImports(name, LookupMode.EVERYTHING) { scope, name -> scope.getSyntheticExtensionFunctions(receiverTypes, name) }
}
override fun getSyntheticExtensionProperties(receiverTypes: Collection<JetType>): Collection<PropertyDescriptor> {
// we do not perform any filtering by visibility here because all descriptors from both visible/invisible filter scopes are to be added anyway
if (filteringKind == FilteringKind.INVISIBLE_CLASSES) return listOf()