Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show of StepRangeLen fails due to missing TwinPrecision zero #53588

Closed
pablosanjose opened this issue Mar 4, 2024 · 3 comments
Closed

show of StepRangeLen fails due to missing TwinPrecision zero #53588

pablosanjose opened this issue Mar 4, 2024 · 3 comments
Labels
regression Regression in behavior compared to a previous version

Comments

@pablosanjose
Copy link
Contributor

pablosanjose commented Mar 4, 2024

Regression since 1.9.1, possibly linked to #44292 and its resolution #44313

julia> range(0, 1, 3) .+ 1im
Error showing value of type StepRangeLen{ComplexF64, Base.TwicePrecision{ComplexF64}, Base.TwicePrecision{Float64}, Int64}:
ERROR: MethodError: no method matching zero(::Base.TwicePrecision{Float64})

Closest candidates are:
  zero(::Type{Union{}}, Any...)
   @ Base number.jl:310
  zero(::Type{Pkg.Resolve.VersionWeight})
   @ Pkg ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/Resolve/versionweights.jl:15
  zero(::Type{LibGit2.GitHash})
   @ LibGit2 ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/LibGit2/src/oid.jl:221
  ...

Stacktrace:
  [1] iszero(x::Base.TwicePrecision{Float64})
    @ Base ./number.jl:42
  [2] show(io::IOContext{Base.TTY}, r::StepRangeLen{ComplexF64, Base.TwicePrecision{…}, Base.TwicePrecision{…}, Int64})
    @ Base ./range.jl:1111
  [3] show(io::IOContext{…}, ::MIME{…}, r::StepRangeLen{…})
    @ Base ./show.jl:13
  [4] (::REPL.var"#55#56"{REPL.REPLDisplay{REPL.LineEditREPL}, MIME{Symbol("text/plain")}, Base.RefValue{Any}})(io::Any)
    @ REPL ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:273
  [5] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:569
  [6] display(d::REPL.REPLDisplay, mime::MIME{Symbol("text/plain")}, x::Any)
    @ REPL ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:259
  [7] display(d::REPL.REPLDisplay, x::Any)
    @ REPL ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:278
  [8] display(x::Any)
    @ Base.Multimedia ./multimedia.jl:340
  [9] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{…})
    @ REPL ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:0
 [10] (::REPL.var"#57#58"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:284
 [11] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:569
 [12] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:282
 [13] (::REPL.var"#do_respond#80"{})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:911
 [14] #invokelatest#2
    @ ./essentials.jl:892 [inlined]
 [15] invokelatest
    @ ./essentials.jl:889 [inlined]
 [16] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/LineEdit.jl:2656
 [17] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:1312
 [18] (::REPL.var"#62#68"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:386
Some type information was truncated. Use `show(err)` to see complete types.

@Seelengrab
Copy link
Contributor

Seelengrab commented Mar 4, 2024

For context, this worked in 1.8.5:

julia> range(0, 1, 3) .+ 1im
0.0 + 1.0im:Base.TwicePrecision{Float64}(0.5, 0.0):1.0 + 1.0im

julia> versioninfo()
Julia Version 1.8.5
Commit 17cfb8e65ea (2023-01-08 06:45 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 24 × AMD Ryzen 9 7900X 12-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, znver3)
  Threads: 1 on 24 virtual cores
Environment:
  JULIA_PKG_USE_CLI_GIT = true

and crashes with the above since at least 1.9.2 (possibly earlier).

@Seelengrab Seelengrab added the regression Regression in behavior compared to a previous version label Mar 4, 2024
@pablosanjose
Copy link
Contributor Author

1.9 works, 1.9.1 fails

@pablosanjose
Copy link
Contributor Author

Closing as duplicate of #52713

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Regression in behavior compared to a previous version
Projects
None yet
Development

No branches or pull requests

2 participants