FIR: render constructor resolve phase in FirRenderer when renderDeclarationResolvePhase is requested
This commit is contained in:
@@ -340,9 +340,7 @@ class FirRenderer(builder: StringBuilder, private val mode: RenderMode = RenderM
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun visitDeclaration(declaration: FirDeclaration) {
|
override fun visitDeclaration(declaration: FirDeclaration) {
|
||||||
if (mode.renderDeclarationResolvePhase) {
|
declaration.renderPhaseIfNeeded()
|
||||||
print("[${declaration.resolvePhase}] ")
|
|
||||||
}
|
|
||||||
print(
|
print(
|
||||||
when (declaration) {
|
when (declaration) {
|
||||||
is FirRegularClass -> declaration.classKind.name.toLowerCase().replace("_", " ")
|
is FirRegularClass -> declaration.classKind.name.toLowerCase().replace("_", " ")
|
||||||
@@ -359,6 +357,12 @@ class FirRenderer(builder: StringBuilder, private val mode: RenderMode = RenderM
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun FirDeclaration.renderPhaseIfNeeded() {
|
||||||
|
if (mode.renderDeclarationResolvePhase) {
|
||||||
|
print("[${resolvePhase}] ")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun List<FirDeclaration>.renderDeclarations() {
|
private fun List<FirDeclaration>.renderDeclarations() {
|
||||||
renderInBraces {
|
renderInBraces {
|
||||||
for (declaration in this) {
|
for (declaration in this) {
|
||||||
@@ -458,6 +462,7 @@ class FirRenderer(builder: StringBuilder, private val mode: RenderMode = RenderM
|
|||||||
if (constructor.isActual) {
|
if (constructor.isActual) {
|
||||||
print("actual ")
|
print("actual ")
|
||||||
}
|
}
|
||||||
|
constructor.renderPhaseIfNeeded()
|
||||||
print("constructor")
|
print("constructor")
|
||||||
constructor.typeParameters.renderTypeParameters()
|
constructor.typeParameters.renderTypeParameters()
|
||||||
constructor.valueParameters.renderParameters()
|
constructor.valueParameters.renderParameters()
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
FILE: classMembers.kt
|
FILE: classMembers.kt
|
||||||
public final [BODY_RESOLVE] class A : R|kotlin/Any| {
|
public final [BODY_RESOLVE] class A : R|kotlin/Any| {
|
||||||
public constructor(): R|A| {
|
public [CONTRACTS] constructor(): R|A| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ FILE: delegates.kt
|
|||||||
}
|
}
|
||||||
public final [STATUS] fun receive(value: R|kotlin/Int|): R|kotlin/Unit| { LAZY_BLOCK }
|
public final [STATUS] fun receive(value: R|kotlin/Int|): R|kotlin/Unit| { LAZY_BLOCK }
|
||||||
public final [IMPLICIT_TYPES_BODY_RESOLVE] val delegate: R|kotlin/properties/ReadWriteProperty<kotlin/Any?, kotlin/Int>| = object : R|kotlin/properties/ReadWriteProperty<kotlin/Any?, kotlin/Int>| {
|
public final [IMPLICIT_TYPES_BODY_RESOLVE] val delegate: R|kotlin/properties/ReadWriteProperty<kotlin/Any?, kotlin/Int>| = object : R|kotlin/properties/ReadWriteProperty<kotlin/Any?, kotlin/Int>| {
|
||||||
private constructor(): R|<anonymous>| {
|
private [BODY_RESOLVE] constructor(): R|<anonymous>| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -4,6 +4,6 @@ FILE: secondaryConstructor.kt
|
|||||||
}
|
}
|
||||||
public final [STATUS] fun receive(value: R|A|): R|kotlin/Unit| { LAZY_BLOCK }
|
public final [STATUS] fun receive(value: R|A|): R|kotlin/Unit| { LAZY_BLOCK }
|
||||||
public final [STATUS] class A : R|kotlin/Any| {
|
public final [STATUS] class A : R|kotlin/Any| {
|
||||||
public constructor(x: R|kotlin/Int|): R|A| { LAZY_BLOCK }
|
public [STATUS] constructor(x: R|kotlin/Int|): R|A| { LAZY_BLOCK }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
FILE: main.kt
|
FILE: main.kt
|
||||||
public final [BODY_RESOLVE] class WithElvis : R|kotlin/Any| {
|
public final [BODY_RESOLVE] class WithElvis : R|kotlin/Any| {
|
||||||
public constructor(value: R|kotlin/String?|): R|elvis/WithElvis| {
|
public [CONTRACTS] constructor(value: R|kotlin/String?|): R|elvis/WithElvis| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
FILE: main.kt
|
FILE: main.kt
|
||||||
public final [BODY_RESOLVE] class Foo : R|kotlin/Any| {
|
public final [BODY_RESOLVE] class Foo : R|kotlin/Any| {
|
||||||
public constructor(): R|Foo| {
|
public [BODY_RESOLVE] constructor(): R|Foo| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ FILE: main.kt
|
|||||||
public final [CONTRACTS] val x: R|kotlin/Int|
|
public final [CONTRACTS] val x: R|kotlin/Int|
|
||||||
public get(): R|kotlin/Int|
|
public get(): R|kotlin/Int|
|
||||||
|
|
||||||
public constructor(): R|Foo| {
|
public [BODY_RESOLVE] constructor(): R|Foo| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
this@R|/Foo|.R|/Foo.x| = Int(42)
|
this@R|/Foo|.R|/Foo.x| = Int(42)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
FILE: main.kt
|
FILE: main.kt
|
||||||
public final [STATUS] class My : R|kotlin/Any| {
|
public final [STATUS] class My : R|kotlin/Any| {
|
||||||
public constructor(): R|My| {
|
public [STATUS] constructor(): R|My| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user