Skip to content

Commit

Permalink
fix bug for getindex(::Number, ::Real)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebolewski committed Oct 26, 2014
1 parent 12a59f7 commit b718cbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/number.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ endof(x::Number) = 1
getindex(x::Number) = x
getindex(x::Number, i::Integer) = i == 1 ? x : throw(BoundsError())
getindex(x::Number, I::Integer...) = all([i == 1 for i in I]) ? x : throw(BoundsError())
getindex(x::Number, I::Real...) = getindex(x, to_index(i)...)
getindex(x::Number, I::Real...) = getindex(x, to_index(I)...)
first(x::Number) = x
last(x::Number) = x

Expand Down

3 comments on commit b718cbc

@tkelman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There wasn't a test of this then?

@tkelman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ivarne
Copy link
Member

@ivarne ivarne commented on b718cbc Oct 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backported in 3ad21b0

Please sign in to comment.