Merge pull request #1168 from vladimirov001/kotlin_verify_error_on_android_kitkat_devices

R8 triggers VerifyError on KitKat devices
This commit is contained in:
Jesse Wilson
2020-06-26 07:27:15 -04:00
committed by GitHub

View File

@@ -154,16 +154,18 @@ internal class KotlinJsonAdapter<T>(
/** A simple [Map] that uses parameter indexes instead of sorting or hashing. */ /** A simple [Map] that uses parameter indexes instead of sorting or hashing. */
class IndexedParameterMap( class IndexedParameterMap(
private val parameterKeys: List<KParameter>, private val parameterKeys: List<KParameter>,
private val parameterValues: Array<Any?> private val parameterValues: Array<Any?>
) : AbstractMap<KParameter, Any?>() { ) : AbstractMutableMap<KParameter, Any?>() {
override val entries: Set<Entry<KParameter, Any?>> override fun put(key: KParameter, value: Any?): Any? = null
override val entries: MutableSet<MutableMap.MutableEntry<KParameter, Any?>>
get() { get() {
val allPossibleEntries = parameterKeys.mapIndexed { index, value -> val allPossibleEntries = parameterKeys.mapIndexed { index, value ->
SimpleEntry<KParameter, Any?>(value, parameterValues[index]) SimpleEntry<KParameter, Any?>(value, parameterValues[index])
} }
return allPossibleEntries.filterTo(LinkedHashSet<Entry<KParameter, Any?>>()) { return allPossibleEntries.filterTo(mutableSetOf()) {
it.value !== ABSENT_VALUE it.value !== ABSENT_VALUE
} }
} }