You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was reported at JuliaStats/Distances.jl#227. unsafe_convert appears to require SubArray inputs to have Int indices. This is due to the use of RangeIndex in the signature. Is there any reason not to support other integer types?
julia> data =rand(100);
julia> my_view =@view data[1:UInt64(50)];
julia> Base.unsafe_convert(Ptr{Float64}, my_view)
ERROR: conversion to pointer not defined for SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{UInt64}}, true}
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] unsafe_convert(#unused#::Type{Ptr{Float64}}, a::SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{UInt64}}, true})
@ Base ./pointer.jl:67
[3] top-level scope
@ REPL[20]:1
(FWIW RangeIndex is a very old alias, it was even was originally written Union(Int, Range{Int}, UnitRange{Int}, Colon).)
The text was updated successfully, but these errors were encountered:
This was reported at JuliaStats/Distances.jl#227.
unsafe_convert
appears to requireSubArray
inputs to haveInt
indices. This is due to the use ofRangeIndex
in the signature. Is there any reason not to support other integer types?(FWIW
RangeIndex
is a very old alias, it was even was originally writtenUnion(Int, Range{Int}, UnitRange{Int}, Colon)
.)The text was updated successfully, but these errors were encountered: