FIR: Leave only one composite-like scope implementation

This commit is contained in:
Denis Zharkov
2020-06-26 11:53:18 +03:00
parent 09bb755088
commit 66e53305bf
9 changed files with 55 additions and 98 deletions
@@ -11,8 +11,7 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirFunctionSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol
import org.jetbrains.kotlin.name.Name
abstract class FirIterableScope : FirScope() {
protected abstract val scopes: Iterable<FirScope>
class FirCompositeScope(private val scopes: Iterable<FirScope>) : FirScope() {
override fun processClassifiersByNameWithSubstitution(
name: Name,
@@ -38,10 +38,8 @@ abstract class FirScopeProvider {
return when {
nestedClassifierScope != null && callableScope != null ->
FirReadOnlyCompositeScope(listOf(nestedClassifierScope, callableScope))
FirCompositeScope(listOf(nestedClassifierScope, callableScope))
else -> nestedClassifierScope ?: callableScope
}
}
}
private class FirReadOnlyCompositeScope(override val scopes: Iterable<FirScope>) : FirIterableScope()