Skip to content

Constructors for common base types? #34

Closed
@rafaqz

Description

@rafaqz

Tim Besard just made the point

julia> Flatten.modify(CuArray, view(rand(2,2),:,:), Array)
ERROR: MethodError: no method matching SubArray(::CuArray{Float64,2}, ::Tuple{Base.Slice{Base.OneTo{Int64}},Base.Slice{Base.OneTo{Int64}}}, ::Int64, ::Int64)

And of course

using Setfield
sa = view(zeros(10, 10), :, :)
julia> @set sa.offset1 = 2
ERROR: MethodError: no method matching SubArray(::Array{Float64,2}, ::Tuple{Base.Slice{Base.OneTo{Int64}},Base.Slice{Base.OneTo{Int64}}}, ::Int64, ::Int64)

Should we add some constructors for common base wrapper types like SubArray?

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