JuliaArrays / JuliaArrays/InfiniteArrays.jl

Type for `broadcast(-, 1:2:∞, 0.3)` changed in Julia 1.8

Open
#89 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
76
Forks
9
Avg merge
16h 56m
Merged PRs (30d)
1

Description

# 1.8
julia> broadcast(-, 1:2:∞, 0.3) |> typeof
StepRangeLen{Infinities.Infinity, Float64, Int64, Integer}

# 1.7
julia> broadcast(-, 1:2:∞, 0.3) |> typeof
InfiniteArrays.InfStepRange{Float64, Float64}

This breaks some stuff later:

julia> broadcast(-, 1:2:∞, 0.3)
Error showing value of type StepRangeLen{Infinities.Infinity, Float64, Int64, Integer}:
ERROR: MethodError: no method matching Infinities.Infinity(::Float64)
Closest candidates are:
  (::Type{T})(::T) where T<:Number at ~/julia/usr/share/julia/base/boot.jl:772
  Infinities.Infinity() at ~/.julia/packages/Infinities/WAhkk/src/Infinities.jl:24
  (::Type{T})(::AbstractChar) where T<:Union{AbstractChar, Number} at ~/julia/usr/share/julia/base/char.jl:50
  ...
Stacktrace:
  [1] unsafe_getindex(r::StepRangeLen{Infinities.Infinity, Float64, Int64, Integer}, i::Int64)
    @ Base ./range.jl:940
  [2] show(io::IOContext{Base.TTY}, r::StepRangeLen{Infinities.Infinity, Float64, Int64, Integer})
    @ Base ./range.jl:0
  [3] show(io::IOContext{Base.TTY}, #unused#::MIME{Symbol("text/plain")}, r::StepRangeLen{Infinities.Infinity, Float64, Int64, Integer})
...

Maybe something has to be overloaded for StepRangeLen as well?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the broadcast expression on Julia 1.7 and 1.8, then inspect the StepRangeLen failure at Julia's base/range.jl:940 and the Infinities.Infinity constructors shown in the error. Compare the resulting StepRangeLen with InfiniteArrays.InfStepRange and determine the compatibility point that needs investigation. Done means broadcast(-, 1:2:∞, 0.3) can be evaluated and displayed without the shown MethodError.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.