Skip to content

Commit

Permalink
Add test for issue #20469
Browse files Browse the repository at this point in the history
  • Loading branch information
mbauman committed Aug 30, 2017
1 parent f4d4c8e commit c058612
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/boundscheck_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,14 @@ else
@test inbounds_isassigned(Int[], 2) == false
end

# Test that @inbounds annotations don't propagate too far for Array; Issue #20469
struct BadVector20469{T} <: AbstractVector{Int}
data::T
end
Base.size(X::BadVector20469) = size(X.data)
Base.getindex(X::BadVector20469, i::Int) = X.data[i-1]
if bc_opt != bc_off
@test_throws BoundsError BadVector20469([1,2,3])[:]
end

end

0 comments on commit c058612

Please sign in to comment.