[IR generator] Introduce constants for List-like types

This commit is contained in:
Sergej Jaskiewicz
2023-09-14 18:30:22 +02:00
committed by Space Team
parent 4e37ac6ed8
commit 15751333e3
2 changed files with 6 additions and 9 deletions
@@ -65,15 +65,9 @@ private fun transformFieldConfig(fc: FieldConfig): Field = when (fc) {
)
is ListFieldConfig -> {
val listType = when (fc.mutability) {
ListFieldConfig.Mutability.List -> type(
"kotlin.collections",
"MutableList",
)
ListFieldConfig.Mutability.Array -> type(
"kotlin.",
"Array",
)
else -> type("kotlin.collections", "List")
ListFieldConfig.Mutability.List -> StandardTypes.mutableList
ListFieldConfig.Mutability.Array -> StandardTypes.array
else -> StandardTypes.list
}
ListField(
fc,
@@ -9,6 +9,9 @@ object StandardTypes {
val boolean = type<Boolean>()
val string = type<String>()
val int = type<Int>()
val array = type<Array<*>>()
val list = type<List<*>>()
val mutableList = type("kotlin.collections", "MutableList")
val collection = type<Collection<*>>()
val map = type<Map<*, *>>()
}