diff --git a/attributes-kt/src/commonMain/kotlin/space/kscience/attributes/PolymorphicAttribute.kt b/attributes-kt/src/commonMain/kotlin/space/kscience/attributes/PolymorphicAttribute.kt index b61d4c477..80767421a 100644 --- a/attributes-kt/src/commonMain/kotlin/space/kscience/attributes/PolymorphicAttribute.kt +++ b/attributes-kt/src/commonMain/kotlin/space/kscience/attributes/PolymorphicAttribute.kt @@ -21,11 +21,13 @@ public abstract class PolymorphicAttribute(public val type: SafeType) : At /** * Get a polymorphic attribute using attribute factory */ +@UnstableAttributesAPI public operator fun Attributes.get(attributeKeyBuilder: () -> PolymorphicAttribute): T? = get(attributeKeyBuilder()) /** * Set a polymorphic attribute using its factory */ +@UnstableAttributesAPI public operator fun AttributesBuilder.set(attributeKeyBuilder: () -> PolymorphicAttribute, value: T) { set(attributeKeyBuilder(), value) } diff --git a/kmath-optimization/src/commonMain/kotlin/space/kscience/kmath/optimization/OptimizationProblem.kt b/kmath-optimization/src/commonMain/kotlin/space/kscience/kmath/optimization/OptimizationProblem.kt index 18f552bda..b9530f83c 100644 --- a/kmath-optimization/src/commonMain/kotlin/space/kscience/kmath/optimization/OptimizationProblem.kt +++ b/kmath-optimization/src/commonMain/kotlin/space/kscience/kmath/optimization/OptimizationProblem.kt @@ -24,7 +24,7 @@ public val OptimizationProblem.startPoint: Map get() = attributes[OptimizationStartPoint()] ?: error("Starting point not defined in $this") public fun AttributesBuilder>.startAt(startingPoint: Map) { - set(::OptimizationStartPoint, startingPoint) + set(OptimizationStartPoint(), startingPoint) }