Value inference includes arrays

This commit is contained in:
Alexander Nozik 2019-04-30 18:29:05 +03:00
parent 1cdf19e533
commit 60ab98dde6
3 changed files with 9 additions and 3 deletions

View File

@ -1,4 +1,4 @@
val dataforgeVersion by extra("0.1.2-dev-5")
val dataforgeVersion by extra("0.1.2-dev-6")
allprojects {
repositories {

View File

@ -1,3 +1,4 @@
import gradle.kotlin.dsl.plugins._e2353938d1a2b15c365d69a8d533ab12.js
import org.gradle.kotlin.dsl.*
plugins {
@ -11,8 +12,6 @@ kotlin {
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
// This was used in kmath-koma, but probably if we need it better to apply it for all modules
freeCompilerArgs = listOf("-progressive")
}
}
}

View File

@ -57,6 +57,13 @@ interface Value {
false -> False
is Number -> NumberValue(value)
is Iterable<*> -> ListValue(value.map { of(it) })
is DoubleArray -> ListValue(value.map { NumberValue(it) })
is IntArray -> ListValue(value.map { NumberValue(it) })
is FloatArray -> ListValue(value.map { NumberValue(it) })
is ShortArray -> ListValue(value.map { NumberValue(it) })
is LongArray -> ListValue(value.map { NumberValue(it) })
is ByteArray -> ListValue(value.map { NumberValue(it) })
is Array<*> -> ListValue(value.map { of(it) })
is Enum<*> -> EnumValue(value)
is CharSequence -> StringValue(value.toString())
else -> throw IllegalArgumentException("Unrecognized type of the object (${value::class}) converted to Value")