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

Test fails on upcoming 1.3 #5

@KristofferC

Description

@KristofferC

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions