[FIR] Add containingDeclarationSymbol to FirTypeParameter

This commit is contained in:
Ivan Kochurkin
2021-07-08 22:31:59 +03:00
committed by TeamCityServer
parent 0c25d280ee
commit 345152d198
11 changed files with 148 additions and 81 deletions
@@ -289,6 +289,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
typeParameter.configure {
+name
+symbol("FirTypeParameterSymbol")
+field("containingDeclarationSymbol", firBasedSymbolType, "*", nullable = true)
+field(varianceType)
+booleanField("isReified")
+fieldList("bounds", typeRef, withReplace = true)
@@ -102,23 +102,23 @@ fun SmartPrinter.printImplementation(implementation: Implementation) {
}
element.allFields.filter { it.type.contains("Symbol") && it !is FieldList }
.takeIf {
it.isNotEmpty() && !isInterface && !isAbstract &&
!element.type.contains("Reference")
&& !element.type.contains("ResolvedQualifier")
&& !element.type.endsWith("Ref")
}
?.let { symbolFields ->
println("init {")
for (symbolField in symbolFields) {
withIndent {
println("${symbolField.name}${symbolField.call()}bind(this)")
}
element.allFields.filter {
it.name != "containingDeclarationSymbol" && it.type.contains("Symbol") && it !is FieldList
}.takeIf {
it.isNotEmpty() && !isInterface && !isAbstract &&
!element.type.contains("Reference")
&& !element.type.contains("ResolvedQualifier")
&& !element.type.endsWith("Ref")
}?.let { symbolFields ->
println("init {")
for (symbolField in symbolFields) {
withIndent {
println("${symbolField.name}${symbolField.call()}bind(this)")
}
println("}")
println()
}
println("}")
println()
}
fun Field.acceptString(): String = "${name}${call()}accept(visitor, data)"
if (!isInterface && !isAbstract) {