Skip to content
This repository has been archived by the owner on Apr 30, 2022. It is now read-only.

Test fails on upcoming 1.3 #5

Closed
KristofferC opened this issue Sep 20, 2019 · 0 comments
Closed

Test fails on upcoming 1.3 #5

KristofferC opened this issue Sep 20, 2019 · 0 comments

Comments

@KristofferC
Copy link

After JuliaLang/julia#32122 the following behavior is different from 1.3 and 1.2

1.2:

julia> a = fill(1 + im)
0-dimensional Array{Complex{Int64},0}:
1 + 1im

julia> -a
-1 - 1im

1.3:

julia> a = fill(1 + im)
0-dimensional Array{Complex{Int64},0}:
1 + 1im

julia> -a
0-dimensional Array{Complex{Int64},0}:
-1 - 1im

This causes one of the tests here to fail with:

random diff circuit: Error During Test at /root/.julia/packages/YaoExtensions/VAbtx/test/CircuitBuild.jl:43
  Got exception outside of a @test
  MethodError: Cannot `convert` an object of type Array{Float64,0} to an object of type Float64
  Closest candidates are:
    convert(::Type{Float64}, !Matched::SymEngine.BasicType{Val{:RealDouble}}) at /root/.julia/packages/SymEngine/zSUGO/src/numerics.jl:35
    convert(::Type{Float64}, !Matched::SymEngine.Basic) at /root/.julia/packages/SymEngine/zSUGO/src/numerics.jl:179
    convert(::Type{T}, !Matched::SymEngine.Basic) where T<:Real at /root/.julia/packages/SymEngine/zSUGO/src/numerics.jl:184
    ...

The difference is that here:

pushfirst!(collector, -g |> imag)

g is a 0-dimensional array. In 1.2 this would get downgraded to a scalar while in 1.3 it keeps being a 0-d Array.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant