[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 -> {
|
is ListFieldConfig -> {
|
||||||
val listType = when (fc.mutability) {
|
val listType = when (fc.mutability) {
|
||||||
ListFieldConfig.Mutability.List -> type(
|
ListFieldConfig.Mutability.List -> StandardTypes.mutableList
|
||||||
"kotlin.collections",
|
ListFieldConfig.Mutability.Array -> StandardTypes.array
|
||||||
"MutableList",
|
else -> StandardTypes.list
|
||||||
)
|
|
||||||
ListFieldConfig.Mutability.Array -> type(
|
|
||||||
"kotlin.",
|
|
||||||
"Array",
|
|
||||||
)
|
|
||||||
else -> type("kotlin.collections", "List")
|
|
||||||
}
|
}
|
||||||
ListField(
|
ListField(
|
||||||
fc,
|
fc,
|
||||||
|
|||||||
+3
@@ -9,6 +9,9 @@ object StandardTypes {
|
|||||||
val boolean = type<Boolean>()
|
val boolean = type<Boolean>()
|
||||||
val string = type<String>()
|
val string = type<String>()
|
||||||
val int = type<Int>()
|
val int = type<Int>()
|
||||||
|
val array = type<Array<*>>()
|
||||||
|
val list = type<List<*>>()
|
||||||
|
val mutableList = type("kotlin.collections", "MutableList")
|
||||||
val collection = type<Collection<*>>()
|
val collection = type<Collection<*>>()
|
||||||
val map = type<Map<*, *>>()
|
val map = type<Map<*, *>>()
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user