Skip to content

Commit 56ec5c6

Browse files
authored
qualify Base.string_index_err (#13)
1 parent f43e38b commit 56ec5c6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/decoding.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ Base.getindex(s::StringView, r::UnitRange{<:Integer}) = s[Int(first(r)):Int(last
7272
i, j = first(r), last(r)
7373
@boundscheck begin
7474
checkbounds(s, r)
75-
@inbounds isvalid(s, i) || string_index_err(s, i)
76-
@inbounds isvalid(s, j) || string_index_err(s, j)
75+
@inbounds isvalid(s, i) || Base.string_index_err(s, i)
76+
@inbounds isvalid(s, j) || Base.string_index_err(s, j)
7777
end
7878
j = nextind(s, j) - 1
7979
return StringView(@view s.data[i:j])

test/runtests.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,7 @@ end
133133
for str in (s, abc, invalid, ss, su), f in (hash, reverse)
134134
@test f(str) == f(String(str))
135135
end
136+
137+
# issue #12
138+
@test_throws StringIndexError StringView(codeunits("fooα"))[1:5]
136139
end

0 commit comments

Comments
 (0)