diff --git a/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/Expression.kt b/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/Expression.kt index 7e1eb0cd7..9743363c6 100644 --- a/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/Expression.kt +++ b/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/Expression.kt @@ -3,6 +3,7 @@ package kscience.kmath.expressions import kscience.kmath.operations.Algebra import kotlin.jvm.JvmName import kotlin.properties.ReadOnlyProperty +import kotlin.reflect.KProperty /** * A marker interface for a symbol. A symbol mus have an identity @@ -84,8 +85,8 @@ public interface ExpressionAlgebra : Algebra { public fun ExpressionAlgebra.bind(symbol: Symbol): E = bindOrNull(symbol) ?: error("Symbol $symbol could not be bound to $this") -public val symbol: ReadOnlyProperty = ReadOnlyProperty { _, property -> - StringSymbol(property.name) +public val symbol: ReadOnlyProperty = object : ReadOnlyProperty { + override fun getValue(thisRef: Any?, property: KProperty<*>): StringSymbol = StringSymbol(property.name) } public fun ExpressionAlgebra.binding(): ReadOnlyProperty = diff --git a/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/SimpleAutoDiff.kt b/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/SimpleAutoDiff.kt index e66832fdb..5a9642690 100644 --- a/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/SimpleAutoDiff.kt +++ b/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/SimpleAutoDiff.kt @@ -244,7 +244,6 @@ public fun > simpleAutoDiff(field: F): AutoDiffProcessor