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

Zeros(∞)[∞] #119

Open
putianyi889 opened this issue Mar 16, 2023 · 1 comment
Open

Zeros(∞)[∞] #119

putianyi889 opened this issue Mar 16, 2023 · 1 comment

Comments

@putianyi889
Copy link
Contributor

julia> Zeros(∞)[∞]
ERROR: MethodError: _unsafe_getindex(::IndexCartesian, ::Zeros{Float64, 1, Tuple{InfiniteArrays.OneToInf{Int64}}}, ::Infinities.InfiniteCardinal{0}) is ambiguous. Candidates:
  _unsafe_getindex(::IndexStyle, F::FillArrays.AbstractFill, I::Vararg{Union{Real, AbstractArray}, N}) where N in FillArrays at C:\Users\pty\.julia\packages\FillArrays\VUZcr\src\FillArrays.jl:193
  _unsafe_getindex(::IndexStyle, A::AbstractArray, I::Infinities.InfiniteCardinal{0}) in Infinities at C:\Users\pty\.julia\dev\Infinities\src\cardinality.jl:201
Possible fix, define
  _unsafe_getindex(::IndexStyle, ::FillArrays.AbstractFill, ::Infinities.InfiniteCardinal{0})
Stacktrace:
 [1] _getindex(l::IndexCartesian, A::Zeros{Float64, 1, Tuple{InfiniteArrays.OneToInf{Int64}}}, I::Infinities.InfiniteCardinal{0})
   @ Base .\multidimensional.jl:875
 [2] getindex(A::Zeros{Float64, 1, Tuple{InfiniteArrays.OneToInf{Int64}}}, I::Infinities.Infinity)
   @ Base .\abstractarray.jl:1241
 [3] top-level scope
   @ REPL[18]:1
@jishnub
Copy link
Member

jishnub commented Jul 18, 2023

Related: #132. I would argue that this isn't a well-defined operation. Indices should be finite, even if the array is infinite.

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

No branches or pull requests

2 participants