From 97971e53dbd7b4d4a3a095923acfaae69d824c99 Mon Sep 17 00:00:00 2001 From: Michael Huster Date: Wed, 3 Jan 2024 16:57:23 +0100 Subject: [PATCH] fix(modelql): fix serialization of nullMono --- .../kotlin/org/modelix/modelql/typed/TypedModelQL.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modelql-typed/src/commonMain/kotlin/org/modelix/modelql/typed/TypedModelQL.kt b/modelql-typed/src/commonMain/kotlin/org/modelix/modelql/typed/TypedModelQL.kt index 2069c02cf1..84deb8876a 100644 --- a/modelql-typed/src/commonMain/kotlin/org/modelix/modelql/typed/TypedModelQL.kt +++ b/modelql-typed/src/commonMain/kotlin/org/modelix/modelql/typed/TypedModelQL.kt @@ -168,8 +168,9 @@ object TypedModelQL { return input.map { referenceOrNull(it, link) } } + @Suppress("UNCHECKED_CAST") fun setReference(input: IMonoStep, link: ITypedReferenceLink, target: IMonoStep?): IMonoStep { - val targetOrNull = target?.untyped() ?: nullMono() + val targetOrNull = target?.untyped() ?: nullMono() as IMonoStep // cast is necessary since nullMono cannot be serialized input.untyped().setReference(link.untyped(), targetOrNull) return input }