Skip to content

Commit

Permalink
Merge pull request #1140 from JuliaSymbolics/s/complex-metadata-fix
Browse files Browse the repository at this point in the history
Fix wrong metadata access
  • Loading branch information
ChrisRackauckas authored May 17, 2024
2 parents 0b963e7 + 0018e49 commit c719ebf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ SpecialFunctions = "2"
StaticArrays = "1.1"
SymbolicIndexingInterface = "0.3.14"
SymbolicLimits = "0.2.0"
SymbolicUtils = "1.4"
SymbolicUtils = "1.7"
julia = "1.10"

[extras]
Expand Down
2 changes: 1 addition & 1 deletion src/complex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ symtype(a::ComplexTerm{T}) where T = Complex{T}
istree(a::ComplexTerm) = true
operation(a::ComplexTerm{T}) where T = Complex{T}
arguments(a::ComplexTerm) = [a.re, a.im]
metadata(a::ComplexTerm) = a.re.metadata
metadata(a::ComplexTerm) = metadata(a.re)

function similarterm(t::ComplexTerm, f, args, symtype; metadata=nothing)
if f <: Complex
Expand Down
2 changes: 2 additions & 0 deletions test/complex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ end
@test_nowarn substitute(z1, z=>1.0im)
@test metadata(z1) == unwrap(z1.im).metadata
@test metadata(z1) == unwrap(z1.re).metadata
z2 = 1.0 + z*im
@test isnothing(metadata(unwrap(z1.re)))
end

0 comments on commit c719ebf

Please sign in to comment.