[IR generator] Introduce constants for List-like types
This commit is contained in:
committed by
Space Team
parent
4e37ac6ed8
commit
15751333e3
+3
-9
@@ -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,
|
||||
|
||||
+3
@@ -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<*, *>>()
|
||||
}
|
||||
Reference in New Issue
Block a user