Add withBindThis to field configuration
This commit is contained in:
+3
-1
@@ -289,7 +289,9 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
typeParameter.configure {
|
||||
+name
|
||||
+symbol("FirTypeParameterSymbol")
|
||||
+field("containingDeclarationSymbol", firBasedSymbolType, "*", nullable = true)
|
||||
+field("containingDeclarationSymbol", firBasedSymbolType, "*", nullable = true).apply {
|
||||
withBindThis = false
|
||||
}
|
||||
+field(varianceType)
|
||||
+booleanField("isReified")
|
||||
+fieldList("bounds", typeRef, withReplace = true)
|
||||
|
||||
+9
-2
@@ -28,6 +28,8 @@ sealed class Field : Importable {
|
||||
open val overridenTypes: MutableSet<Importable> = mutableSetOf()
|
||||
open var useNullableForReplace: Boolean = false
|
||||
|
||||
var withBindThis = true
|
||||
|
||||
fun copy(): Field = internalCopy().also {
|
||||
updateFieldsInCopy(it)
|
||||
}
|
||||
@@ -137,7 +139,9 @@ class SimpleField(
|
||||
customType,
|
||||
nullable,
|
||||
withReplace
|
||||
)
|
||||
).apply {
|
||||
withBindThis = this@SimpleField.withBindThis
|
||||
}
|
||||
}
|
||||
|
||||
fun replaceType(newType: Type) = SimpleField(
|
||||
@@ -148,6 +152,7 @@ class SimpleField(
|
||||
nullable,
|
||||
withReplace
|
||||
).also {
|
||||
it.withBindThis = withBindThis
|
||||
updateFieldsInCopy(it)
|
||||
}
|
||||
}
|
||||
@@ -176,7 +181,9 @@ class FirField(
|
||||
element,
|
||||
nullable,
|
||||
withReplace
|
||||
)
|
||||
).apply {
|
||||
withBindThis = this@FirField.withBindThis
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ fun SmartPrinter.printImplementation(implementation: Implementation) {
|
||||
|
||||
|
||||
element.allFields.filter {
|
||||
it.name != "containingDeclarationSymbol" && it.type.contains("Symbol") && it !is FieldList
|
||||
it.withBindThis && it.type.contains("Symbol") && it !is FieldList
|
||||
}.takeIf {
|
||||
it.isNotEmpty() && !isInterface && !isAbstract &&
|
||||
!element.type.contains("Reference")
|
||||
|
||||
Reference in New Issue
Block a user