[tree generator] Make defaultEmptyList#withGetter false by default

to align it with other default* methods.

This will be helpful for configuring IR implementation,
where there are many such empty lists.
This commit is contained in:
Wojciech Litewka
2024-02-14 11:16:26 +01:00
committed by Space Team
parent 5d7a5245ff
commit 665bd5153a
2 changed files with 7 additions and 7 deletions
@@ -244,16 +244,16 @@ abstract class AbstractImplementationConfigurator<Implementation, Element, Imple
/**
* Specifies that the default value of each field of [fields] in this implementation class should be [emptyList].
*
* Always forces generation of a getter-only computed property.
* @param withGetter If `true`, the field will be generated as a computed property instead of stored one.
*/
fun defaultEmptyList(vararg fields: String) {
fun defaultEmptyList(vararg fields: String, withGetter: Boolean = false) {
for (field in fields) {
require(getField(field).origin is ListField) {
"$field is list field"
}
default(field) {
value = "emptyList()"
withGetter = true
this.withGetter = withGetter
}
}
}