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