[FIR] Add toString to all type scopes

This commit is contained in:
Dmitriy Novozhilov
2021-12-09 12:02:10 +03:00
parent e4978d8022
commit d588b2e654
9 changed files with 36 additions and 0 deletions
@@ -347,6 +347,10 @@ class FirClassSubstitutionScope(
override fun getClassifierNames(): Set<Name> {
return useSiteMemberScope.getClassifierNames()
}
override fun toString(): String {
return "Substitution scope for [$useSiteMemberScope] for type $dispatchReceiverTypeForSubstitutedMembers"
}
}
class FirSubstitutionOverrideStorage(val session: FirSession) : FirSessionComponent {
@@ -55,4 +55,8 @@ class FirClassUseSiteMemberScope(
}
return result
}
override fun toString(): String {
return "Use site scope of $classId"
}
}
@@ -83,4 +83,8 @@ class FirScopeWithFakeOverrideTypeCalculator(
override val scopeOwnerLookupNames: List<String>
get() = delegate.scopeOwnerLookupNames
override fun toString(): String {
return delegate.toString()
}
}
@@ -127,6 +127,10 @@ class FirTypeIntersectionScope private constructor(
return scopes.flatMapTo(hashSetOf()) { it.getClassifierNames() }
}
override fun toString(): String {
return "Intersection of [${scopes.joinToString(", ")}]"
}
companion object {
fun prepareIntersectionScope(
session: FirSession,