FIR: Minor. Extract FirDeclarationsResolveTransformer::doTransformRegularClass
It's will be useful in the following commits
This commit is contained in:
+15
-4
@@ -323,12 +323,22 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor
|
|||||||
return regularClass.runAllPhasesForLocalClass(transformer, components, data).compose()
|
return regularClass.runAllPhasesForLocalClass(transformer, components, data).compose()
|
||||||
}
|
}
|
||||||
|
|
||||||
val notAnalyzed = regularClass.resolvePhase < transformerPhase
|
|
||||||
|
|
||||||
return withTypeParametersOf(regularClass) {
|
return withTypeParametersOf(regularClass) {
|
||||||
|
doTransformRegularClass(regularClass, data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun doTransformRegularClass(
|
||||||
|
regularClass: FirRegularClass,
|
||||||
|
data: ResolutionMode
|
||||||
|
): CompositeTransformResult.Single<FirRegularClass> {
|
||||||
|
val notAnalyzed = regularClass.resolvePhase < transformerPhase
|
||||||
|
|
||||||
if (notAnalyzed) {
|
if (notAnalyzed) {
|
||||||
dataFlowAnalyzer.enterClass()
|
dataFlowAnalyzer.enterClass()
|
||||||
}
|
}
|
||||||
|
|
||||||
val oldConstructorScope = primaryConstructorParametersScope
|
val oldConstructorScope = primaryConstructorParametersScope
|
||||||
val oldContainingClass = containingClass
|
val oldContainingClass = containingClass
|
||||||
primaryConstructorParametersScope = null
|
primaryConstructorParametersScope = null
|
||||||
@@ -345,6 +355,7 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor
|
|||||||
}
|
}
|
||||||
transformDeclarationContent(regularClass, data).single as FirRegularClass
|
transformDeclarationContent(regularClass, data).single as FirRegularClass
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notAnalyzed) {
|
if (notAnalyzed) {
|
||||||
if (!implicitTypeOnly) {
|
if (!implicitTypeOnly) {
|
||||||
val controlFlowGraph = dataFlowAnalyzer.exitRegularClass(result)
|
val controlFlowGraph = dataFlowAnalyzer.exitRegularClass(result)
|
||||||
@@ -353,11 +364,11 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor
|
|||||||
dataFlowAnalyzer.exitClass()
|
dataFlowAnalyzer.exitClass()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
containingClass = oldContainingClass
|
containingClass = oldContainingClass
|
||||||
primaryConstructorParametersScope = oldConstructorScope
|
primaryConstructorParametersScope = oldConstructorScope
|
||||||
@Suppress("UNCHECKED_CAST")
|
return (@Suppress("UNCHECKED_CAST")
|
||||||
result.compose()
|
result.compose())
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun transformAnonymousObject(
|
override fun transformAnonymousObject(
|
||||||
|
|||||||
Reference in New Issue
Block a user