From 6a801f9999df5d29640802f74f6bff5c93ceff51 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 23 Aug 2023 09:34:58 +0300 Subject: [PATCH] Fix solid ref signature --- .../kscience/visionforge/solid/SolidReference.kt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/visionforge-solid/src/commonMain/kotlin/space/kscience/visionforge/solid/SolidReference.kt b/visionforge-solid/src/commonMain/kotlin/space/kscience/visionforge/solid/SolidReference.kt index 7203f06f..2770a7aa 100644 --- a/visionforge-solid/src/commonMain/kotlin/space/kscience/visionforge/solid/SolidReference.kt +++ b/visionforge-solid/src/commonMain/kotlin/space/kscience/visionforge/solid/SolidReference.kt @@ -233,13 +233,8 @@ public fun MutableVisionContainer.ref( public fun MutableVisionContainer.ref( templateName: Name, - name: String? = null, -): SolidReference = ref(templateName, name?.parseAsName()) - -public fun MutableVisionContainer.ref( - templateName: String, - name: String? = null, -): SolidReference = ref(Name.parse(templateName), name) + name: String, +): SolidReference = ref(templateName, name.parseAsName()) /** * Add new [SolidReference] wrapping given object and automatically adding it to the prototypes. @@ -258,7 +253,7 @@ public fun SolidGroup.newRef( } else if (existing != obj) { error("Can't add different prototype on top of existing one") } - return children.ref(prototypeName, name) + return children.ref(prototypeName, name?.parseAsName()) }