Skip to content

Commit dbd3590

Browse files
Relax * method for Number and ScaledOperator
1 parent f02cac6 commit dbd3590

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/basic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ end
201201

202202
for T in SCALINGNUMBERTYPES
203203
@eval function ScaledOperator::$T, L::ScaledOperator)
204-
λ = ScalarOperator(λ) * L.λ
204+
λ = λ * L.λ
205205
ScaledOperator(λ, L.L)
206206
end
207207

src/scalar.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,15 +317,15 @@ end
317317
for T in SCALINGNUMBERTYPES[2:end]
318318
@eval function Base.:*::ScalarOperator, x::$T)
319319
if isconstant(α)
320-
T2 = promote_type(T, eltype(α))
320+
T2 = promote_type($T, eltype(α))
321321
return ScalarOperator(convert(T2, α) * x, α.update_func)
322322
else
323323
return ComposedScalarOperator(α, ScalarOperator(x))
324324
end
325325
end
326326
@eval function Base.:*(x::$T, α::ScalarOperator)
327327
if isconstant(α)
328-
T2 = promote_type(T, eltype(α))
328+
T2 = promote_type($T, eltype(α))
329329
return ScalarOperator(convert(T2, α) * x, α.update_func)
330330
else
331331
return ComposedScalarOperator(ScalarOperator(x), α)

0 commit comments

Comments
 (0)