Skip to content
This repository has been archived by the owner on May 4, 2019. It is now read-only.

BoundsError when NullableArray a field #190

Closed
merl-dev opened this issue Apr 4, 2017 · 2 comments
Closed

BoundsError when NullableArray a field #190

merl-dev opened this issue Apr 4, 2017 · 2 comments

Comments

@merl-dev
Copy link

merl-dev commented Apr 4, 2017

Not sure if I missed something about iteration interfaces or NullableArrays, but consider the following (valid for NullableArrays 0.1.0 and master, julia v0.5.1 and 0.6.0-pre.beta.14, on ubuntu 14):

julia> type A
           arr::Array{String}
       end

julia> a = A(String[])
A(String[])

julia> start(a.arr)
1

julia> done(a.arr, 1)
true

julia> using NullableArrays
WARNING: Method definition ==(Base.Nullable{S}, Base.Nullable{T}) in module Base at nullable.jl:244 overwritten in module NullableArrays at /home/yjb/.julia/v0.6/NullableArrays/src/operators.jl:128.

julia> type B
           arr::NullableArray{String}
       end

julia> b = B(NullableArray{String}[])
B(Nullable{String}[])

julia> start(b.arr)
(Base.OneTo(0), 1)

julia> done(b.arr, 1)
ERROR: BoundsError
Stacktrace:
 [1] getindex at ./number.jl:38 [inlined]
 [2] done(::NullableArrays.NullableArray{String,1}, ::Int64) at ./abstractarray.jl:753

To be sure:

julia> c = NullableArray{String}[]
0-element Array{NullableArrays.NullableArray{String,N} where N,1}

julia> start(c)
1

julia> done(c, 1)
true
@merl-dev
Copy link
Author

merl-dev commented Apr 6, 2017

reposting on discourse...

@merl-dev merl-dev closed this as completed Apr 6, 2017
@nalimilan
Copy link
Member

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

No branches or pull requests

2 participants