Skip to content

Commit c020358

Browse files
committed
fix(modelql): fix serialization of nullMono
1 parent 8233140 commit c020358

File tree

1 file changed

+2
-1
lines changed
  • modelql-typed/src/commonMain/kotlin/org/modelix/modelql/typed

1 file changed

+2
-1
lines changed

modelql-typed/src/commonMain/kotlin/org/modelix/modelql/typed/TypedModelQL.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,9 @@ object TypedModelQL {
168168
return input.map { referenceOrNull(it, link) }
169169
}
170170

171+
@Suppress("UNCHECKED_CAST")
171172
fun <SourceT : ITypedNode, TargetT : ITypedNode> setReference(input: IMonoStep<SourceT>, link: ITypedReferenceLink<TargetT>, target: IMonoStep<TargetT?>?): IMonoStep<SourceT> {
172-
val targetOrNull = target?.untyped() ?: nullMono<INode>()
173+
val targetOrNull = target?.untyped() ?: nullMono<String>() as IMonoStep<INode?> // cast is necessary since nullMono<INode> cannot be serialized
173174
input.untyped().setReference(link.untyped(), targetOrNull)
174175
return input
175176
}

0 commit comments

Comments
 (0)