Skip to content

Commit

Permalink
Better use of MethodError
Browse files Browse the repository at this point in the history
  • Loading branch information
ararslan committed Jun 9, 2016
1 parent a355d82 commit 60aae00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/sort.jl
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ sort(v::AbstractVector; kws...) = sort!(copymutable(v); kws...)
## other iterables and fallback ##

sort(s::String; kws...) = String(sort(collect(s); kws...))
sort(n::Number) = throw(MethodError("no method matching sort(::Number)"))
sort(n::Number) = throw(MethodError(sort, n))
sort(itr; kws...) = sort(collect(itr); kws...)


Expand Down

0 comments on commit 60aae00

Please sign in to comment.