Skip to content

Commit 73c8f2b

Browse files
Fix StackOverfloxError on ScalarOperator-UniformScaling multiplication
1 parent 7295fea commit 73c8f2b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/scalar.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,16 +368,14 @@ end
368368
for T in SCALINGNUMBERTYPES[2:end]
369369
@eval function Base.:*::ScalarOperator, x::$T)
370370
if isconstant(α)
371-
T2 = promote_type($T, eltype(α))
372-
return ScalarOperator(convert(T2, α) * x, α.update_func)
371+
return ScalarOperator(concretize(α) * x)
373372
else
374373
return ComposedScalarOperator(α, ScalarOperator(x))
375374
end
376375
end
377376
@eval function Base.:*(x::$T, α::ScalarOperator)
378377
if isconstant(α)
379-
T2 = promote_type($T, eltype(α))
380-
return ScalarOperator(convert(T2, α) * x, α.update_func)
378+
return ScalarOperator(concretize(α) * x)
381379
else
382380
return ComposedScalarOperator(ScalarOperator(x), α)
383381
end

0 commit comments

Comments
 (0)