mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Support ArrayList, LinkedHashMap, HashMap, LinkedHashSet, HashSet for value()
This commit is contained in:
parent
d120bfe576
commit
5adda00be0
@ -44,7 +44,9 @@ internal fun Setting.valueFromKTypeImpl(type: KType): SerializerAwareValue<*> {
|
||||
|
||||
when (classifier) {
|
||||
MutableMap::class,
|
||||
Map::class
|
||||
Map::class,
|
||||
LinkedHashMap::class,
|
||||
HashMap::class
|
||||
-> {
|
||||
val keyClass = type.arguments[0].type?.classifier
|
||||
require(keyClass is KClass<*>)
|
||||
@ -63,10 +65,9 @@ internal fun Setting.valueFromKTypeImpl(type: KType): SerializerAwareValue<*> {
|
||||
).serializableValueWith(serializerMirai(type) as KSerializer<Map<Any?, Any?>>) // erased
|
||||
}
|
||||
}
|
||||
Collection::class,
|
||||
MutableCollection::class,
|
||||
MutableList::class,
|
||||
List::class
|
||||
List::class,
|
||||
ArrayList::class
|
||||
-> {
|
||||
val elementClass = type.arguments[0].type?.classifier
|
||||
require(elementClass is KClass<*>)
|
||||
@ -81,7 +82,9 @@ internal fun Setting.valueFromKTypeImpl(type: KType): SerializerAwareValue<*> {
|
||||
}
|
||||
}
|
||||
MutableSet::class,
|
||||
Set::class
|
||||
Set::class,
|
||||
LinkedHashSet::class,
|
||||
HashSet::class
|
||||
-> {
|
||||
val elementClass = type.arguments[0].type?.classifier
|
||||
require(elementClass is KClass<*>)
|
||||
|
Loading…
Reference in New Issue
Block a user