Skip to content

Commit

Permalink
better BoundsError message and fix 32bit test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Jan 1, 2015
1 parent 49e59ed commit 59d221e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base/replutil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ showerror(io::IO, e) = show(io, e)
function show(io::IO, be::BoundsError)
print(io, "BoundsError(")
if isdefined(be, :a)
print(io, "\n of ")
print(io, "\n attempt to access ")
writemime(io, MIME"text/plain"(), be.a)
if isdefined(be, :i)
print(io, "\n at index [")
Expand Down
2 changes: 1 addition & 1 deletion test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2038,7 +2038,7 @@ f9534e(x) = (a=IOBuffer(); a.(x) = 3)
f9534f() = (a=IOBuffer(); a.(-2))
f9534f(x) = (a=IOBuffer(); a.(x))
@test try; f9534f() catch ex; isa((ex::BoundsError).a,IOBuffer) && ex.i == -2; end
@test try; f9534f(typemin(Int64)+2) catch ex; isa((ex::BoundsError).a,IOBuffer) && ex.i == typemin(Int64)+2; end
@test try; f9534f(typemin(Int)+2) catch ex; isa((ex::BoundsError).a,IOBuffer) && ex.i == typemin(Int)+2; end
x9634 = 3
@test try; getfield(1+2im, x9634); catch ex; (ex::BoundsError).a === 1+2im && ex.i == 3; end
@test try; error(BoundsError()) catch ex; !isdefined((ex::BoundsError), :a) && !isdefined((ex::BoundsError), :i); end
Expand Down

0 comments on commit 59d221e

Please sign in to comment.