FIR: introduce BodyResolveContext.forEnumEntry
This commit is contained in:
+4
@@ -439,6 +439,10 @@ class BodyResolveContext(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline fun <T> forEnumEntry(
|
||||||
|
crossinline f: () -> T
|
||||||
|
): T = withTowerDataMode(FirTowerDataMode.CONSTRUCTOR_HEADER, f)
|
||||||
|
|
||||||
inline fun <T> withAnonymousInitializer(
|
inline fun <T> withAnonymousInitializer(
|
||||||
anonymousInitializer: FirAnonymousInitializer,
|
anonymousInitializer: FirAnonymousInitializer,
|
||||||
crossinline f: () -> T
|
crossinline f: () -> T
|
||||||
|
|||||||
+3
-3
@@ -107,8 +107,8 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor
|
|||||||
override fun transformEnumEntry(enumEntry: FirEnumEntry, data: ResolutionMode): CompositeTransformResult<FirDeclaration> {
|
override fun transformEnumEntry(enumEntry: FirEnumEntry, data: ResolutionMode): CompositeTransformResult<FirDeclaration> {
|
||||||
if (enumEntry.resolvePhase == transformerPhase) return enumEntry.compose()
|
if (enumEntry.resolvePhase == transformerPhase) return enumEntry.compose()
|
||||||
transformer.replaceDeclarationResolvePhaseIfNeeded(enumEntry, transformerPhase)
|
transformer.replaceDeclarationResolvePhaseIfNeeded(enumEntry, transformerPhase)
|
||||||
context.withTowerDataMode(FirTowerDataMode.CONSTRUCTOR_HEADER) {
|
return context.forEnumEntry {
|
||||||
return (enumEntry.transformChildren(this, data) as FirEnumEntry).compose()
|
(enumEntry.transformChildren(this, data) as FirEnumEntry).compose()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor
|
|||||||
if (returnTypeRef !is FirImplicitTypeRef && implicitTypeOnly) return property.compose()
|
if (returnTypeRef !is FirImplicitTypeRef && implicitTypeOnly) return property.compose()
|
||||||
if (property.resolvePhase == transformerPhase) return property.compose()
|
if (property.resolvePhase == transformerPhase) return property.compose()
|
||||||
if (property.resolvePhase == FirResolvePhase.BODY_RESOLVE || property.resolvePhase == transformerPhase) {
|
if (property.resolvePhase == FirResolvePhase.BODY_RESOLVE || property.resolvePhase == transformerPhase) {
|
||||||
return@withTypeParametersOf property.compose()
|
return property.compose()
|
||||||
}
|
}
|
||||||
|
|
||||||
dataFlowAnalyzer.enterProperty(property)
|
dataFlowAnalyzer.enterProperty(property)
|
||||||
|
|||||||
Reference in New Issue
Block a user