[FIR] Rename applyToActualCapturedTypeParameters to appendOuterTypeParameters
This commit is contained in:
committed by
TeamCityServer
parent
d4a11fc295
commit
09510633c7
+2
-6
@@ -449,9 +449,7 @@ class DeclarationsConverter(
|
||||
annotations += modifiers.annotations
|
||||
typeParameters += firTypeParameters
|
||||
|
||||
context.applyToActualCapturedTypeParameters(true) {
|
||||
typeParameters += buildOuterClassTypeParameterRef { symbol = it }
|
||||
}
|
||||
context.appendOuterTypeParameters(ignoreLastLevel = true, typeParameters)
|
||||
|
||||
val selfType = classNode.toDelegatedSelfType(this)
|
||||
registerSelfType(selfType)
|
||||
@@ -588,9 +586,7 @@ class DeclarationsConverter(
|
||||
scopeProvider = baseScopeProvider
|
||||
symbol = FirAnonymousObjectSymbol()
|
||||
status = FirDeclarationStatusImpl(Visibilities.Local, Modality.FINAL)
|
||||
context.applyToActualCapturedTypeParameters(false) {
|
||||
typeParameters += buildOuterClassTypeParameterRef { this.symbol = it }
|
||||
}
|
||||
context.appendOuterTypeParameters(ignoreLastLevel = false, typeParameters)
|
||||
val delegatedSelfType = objectLiteral.toDelegatedSelfType(this)
|
||||
registerSelfType(delegatedSelfType)
|
||||
|
||||
|
||||
@@ -1058,9 +1058,7 @@ open class RawFirBuilder(
|
||||
classOrObject.extractAnnotationsTo(this)
|
||||
classOrObject.extractTypeParametersTo(this, symbol)
|
||||
|
||||
context.applyToActualCapturedTypeParameters(true) {
|
||||
typeParameters += buildOuterClassTypeParameterRef { symbol = it }
|
||||
}
|
||||
context.appendOuterTypeParameters(ignoreLastLevel = true, typeParameters)
|
||||
context.pushFirTypeParameters(
|
||||
status.isInner,
|
||||
typeParameters.subList(0, classOrObject.typeParameters.size)
|
||||
@@ -1158,9 +1156,7 @@ open class RawFirBuilder(
|
||||
scopeProvider = baseScopeProvider
|
||||
symbol = FirAnonymousObjectSymbol()
|
||||
status = FirDeclarationStatusImpl(Visibilities.Local, Modality.FINAL)
|
||||
context.applyToActualCapturedTypeParameters(false) {
|
||||
typeParameters += buildOuterClassTypeParameterRef { symbol = it }
|
||||
}
|
||||
context.appendOuterTypeParameters(ignoreLastLevel = false, typeParameters)
|
||||
val delegatedSelfType = objectDeclaration.toDelegatedSelfType(this)
|
||||
registerSelfType(delegatedSelfType)
|
||||
objectDeclaration.extractAnnotationsTo(this)
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.jetbrains.kotlin.fir.FirLabel
|
||||
import org.jetbrains.kotlin.fir.FirLoopTarget
|
||||
import org.jetbrains.kotlin.fir.PrivateForInline
|
||||
import org.jetbrains.kotlin.fir.declarations.FirTypeParameterRef
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.buildOuterClassTypeParameterRef
|
||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.fir.types.ConeClassLikeType
|
||||
@@ -57,13 +58,13 @@ class Context<T> {
|
||||
list.removeAt(list.lastIndex)
|
||||
}
|
||||
|
||||
inline fun applyToActualCapturedTypeParameters(ignoreLastLevel: Boolean, action: (FirTypeParameterSymbol) -> Unit) {
|
||||
fun appendOuterTypeParameters(ignoreLastLevel: Boolean, typeParameters: MutableList<FirTypeParameterRef>) {
|
||||
for (index in capturedTypeParameters.lastIndex downTo 0) {
|
||||
val element = capturedTypeParameters[index]
|
||||
|
||||
if (index < capturedTypeParameters.lastIndex || !ignoreLastLevel) {
|
||||
for (capturedTypeParameter in element.list) {
|
||||
action(capturedTypeParameter)
|
||||
typeParameters += buildOuterClassTypeParameterRef { symbol = capturedTypeParameter }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user