FIR: update enum entry resolve phase in body resolve transformers
This commit is contained in:
+2
@@ -115,6 +115,8 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor
|
||||
}
|
||||
|
||||
override fun transformEnumEntry(enumEntry: FirEnumEntry, data: ResolutionMode): CompositeTransformResult<FirDeclaration> {
|
||||
if (enumEntry.resolvePhase == transformerPhase) return enumEntry.compose()
|
||||
transformer.replaceDeclarationResolvePhaseIfNeeded(enumEntry, transformerPhase)
|
||||
context.withTowerDataMode(FirTowerDataMode.CONSTRUCTOR_HEADER) {
|
||||
return (enumEntry.transformChildren(this, data) as FirEnumEntry).compose()
|
||||
}
|
||||
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
FILE: enum.kt
|
||||
public final [BODY_RESOLVE] enum class Enum : R|kotlin/Enum<Enum>| {
|
||||
private [BODY_RESOLVE] constructor([BODY_RESOLVE] x: R|kotlin/Int|): R|Enum| {
|
||||
super<R|kotlin/Enum<Enum>|>()
|
||||
}
|
||||
|
||||
public final [BODY_RESOLVE] val x: R|kotlin/Int| = R|<local>/x|
|
||||
[BODY_RESOLVE] public get(): R|kotlin/Int|
|
||||
|
||||
public final static [BODY_RESOLVE] enum entry A: R|Enum| = object : R|Enum| {
|
||||
private [BODY_RESOLVE] constructor(): R|<anonymous>| {
|
||||
super<R|Enum|>(Int(1))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final static [BODY_RESOLVE] fun values(): R|kotlin/Array<Enum>| {
|
||||
}
|
||||
|
||||
public final static [BODY_RESOLVE] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|Enum| {
|
||||
}
|
||||
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
enum class Enum(val x: Int) {
|
||||
A(1),
|
||||
}
|
||||
+5
@@ -44,6 +44,11 @@ public class InnerDeclarationsResolvePhaseTestGenerated extends AbstractInnerDec
|
||||
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/constructorParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("enum.kt")
|
||||
public void testEnum() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/enum.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("funWithoutTypes.kt")
|
||||
public void testFunWithoutTypes() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/funWithoutTypes.kt");
|
||||
|
||||
Reference in New Issue
Block a user