Skip to content

Commit ecebb0a

Browse files
Fix StackOverfloxError on ScalarOperator-UniformScaling multiplication
1 parent 347c2be commit ecebb0a

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
@@ -379,16 +379,14 @@ end
379379
for T in SCALINGNUMBERTYPES[2:end]
380380
@eval function Base.:*::ScalarOperator, x::$T)
381381
if isconstant(α)
382-
T2 = promote_type($T, eltype(α))
383-
return ScalarOperator(convert(T2, α) * x, α.update_func)
382+
return ScalarOperator(concretize(α) * x)
384383
else
385384
return ComposedScalarOperator(α, ScalarOperator(x))
386385
end
387386
end
388387
@eval function Base.:*(x::$T, α::ScalarOperator)
389388
if isconstant(α)
390-
T2 = promote_type($T, eltype(α))
391-
return ScalarOperator(convert(T2, α) * x, α.update_func)
389+
return ScalarOperator(concretize(α) * x)
392390
else
393391
return ComposedScalarOperator(ScalarOperator(x), α)
394392
end

0 commit comments

Comments
 (0)