Skip to content

Commit 19b252e

Browse files
Merge pull request #1406 from JuliaSymbolics/baggepinnen-patch-3
Remove stack-overflowy `convert` method
2 parents 8541338 + d2d3caa commit 19b252e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/num.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ Base.convert(::Type{Num}, x::Symbolic{<:Number}) = Num(x)
177177
Base.convert(::Type{Num}, x::Number) = Num(x)
178178
Base.convert(::Type{Num}, x::Num) = x
179179

180-
Base.convert(::Type{<:Array{Num}}, x::AbstractArray) = map(Num, x)
181-
Base.convert(::Type{<:Array{Num}}, x::AbstractArray{Num}) = x
180+
Base.convert(::Type{T}, x::AbstractArray{Num}) where T <: Array{Num} = T(map(Num, x))
182181
Base.convert(::Type{Sym}, x::Num) = value(x) isa Sym ? value(x) : error("cannot convert $x to Sym")
183182

184183
LinearAlgebra.lu(x::Union{Adjoint{<:RCNum},Transpose{<:RCNum},Array{<:RCNum}}; check=true, kw...) = sym_lu(x; check=check)

0 commit comments

Comments
 (0)