From 6395d9120dbf6b05dff9eb3358eabfbc8680f531 Mon Sep 17 00:00:00 2001 From: Giovanni Ciatto Date: Sat, 27 Jun 2020 20:38:55 +0200 Subject: [PATCH] fix theory objectifiers --- .../kotlin/it/unibo/tuprolog/serialize/JsTheoryObjectifier.kt | 2 +- .../kotlin/it/unibo/tuprolog/serialize/JvmTheoryObjectifier.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/serialize-theory/src/jsMain/kotlin/it/unibo/tuprolog/serialize/JsTheoryObjectifier.kt b/serialize-theory/src/jsMain/kotlin/it/unibo/tuprolog/serialize/JsTheoryObjectifier.kt index 9e5e64ec0..60730622f 100644 --- a/serialize-theory/src/jsMain/kotlin/it/unibo/tuprolog/serialize/JsTheoryObjectifier.kt +++ b/serialize-theory/src/jsMain/kotlin/it/unibo/tuprolog/serialize/JsTheoryObjectifier.kt @@ -6,7 +6,7 @@ class JsTheoryObjectifier : TheoryObjectifier { private val objectifier = JsTermObjectifier() override fun objectify(value: Theory): Any { - return arrayOf(value.map { objectifier.objectify(it) }) + return value.map { objectifier.objectify(it) }.toTypedArray() } override fun objectifyMany(values: Iterable): Any { diff --git a/serialize-theory/src/jvmMain/kotlin/it/unibo/tuprolog/serialize/JvmTheoryObjectifier.kt b/serialize-theory/src/jvmMain/kotlin/it/unibo/tuprolog/serialize/JvmTheoryObjectifier.kt index 823ca6f20..a74e1a88c 100644 --- a/serialize-theory/src/jvmMain/kotlin/it/unibo/tuprolog/serialize/JvmTheoryObjectifier.kt +++ b/serialize-theory/src/jvmMain/kotlin/it/unibo/tuprolog/serialize/JvmTheoryObjectifier.kt @@ -7,7 +7,7 @@ class JvmTheoryObjectifier : TheoryObjectifier { private val objectifier = JvmTermObjectifier() override fun objectify(value: Theory): Any { - return listOf(value.map { objectifier.objectify(it) }) + return value.map { objectifier.objectify(it) } } override fun objectifyMany(values: Iterable): Any {