diff --git a/build.gradle.kts b/build.gradle.kts index ad2766a4..e3972ef4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { id("scientifik.publish") version toolsVersion apply false } -val dataforgeVersion by extra("0.1.6-dev") +val dataforgeVersion by extra("0.1.6-dev-1") val bintrayRepo by extra("dataforge") val githubProject by extra("dataforge-core") diff --git a/dataforge-meta/src/commonMain/kotlin/hep/dataforge/meta/scheme/ConfigurableDelegate.kt b/dataforge-meta/src/commonMain/kotlin/hep/dataforge/meta/scheme/ConfigurableDelegate.kt index ae6722cf..2ee2c282 100644 --- a/dataforge-meta/src/commonMain/kotlin/hep/dataforge/meta/scheme/ConfigurableDelegate.kt +++ b/dataforge-meta/src/commonMain/kotlin/hep/dataforge/meta/scheme/ConfigurableDelegate.kt @@ -171,7 +171,10 @@ fun Configurable.float(default: Float, key: Name? = null): ReadWriteProperty> Configurable.enum( default: E, key: Name? = null ): ReadWriteProperty = - item(default, key).transform { item -> item?.string?.let { enumValueOf(it) } ?: default } + item(default, key).transform { item -> item?.string?.let {str-> + @Suppress("USELESS_CAST") + enumValueOf(str) as E + } ?: default } /* * Extra delegates for special cases