Workaround for KT-37302

This commit is contained in:
Georgy Bronnikov
2020-03-06 11:16:11 +03:00
parent 735fae0e5a
commit ae208f58a4
@@ -188,12 +188,13 @@ internal abstract class KCallableImpl<out R> : KCallable<R> {
private fun defaultPrimitiveValue(type: Type): Any? =
if (type is Class<*> && type.isPrimitive) {
@Suppress("RemoveRedundantCallsOfConversionMethods")
when (type) {
Boolean::class.java -> false
Char::class.java -> 0.toChar()
Byte::class.java -> 0.toByte()
Short::class.java -> 0.toShort()
Int::class.java -> 0
Int::class.java -> 0.toInt() // .toInt() conversion is workaround for KT-37302
Float::class.java -> 0f
Long::class.java -> 0L
Double::class.java -> 0.0