diff --git a/src/Statistics.jl b/src/Statistics.jl index 911f724d..ee83bd1a 100644 --- a/src/Statistics.jl +++ b/src/Statistics.jl @@ -109,7 +109,7 @@ if !isdefined(Base, :mean) f(itr) catch MethodError rethrow(ArgumentError("""mean(f, itr) requires a function and an iterable. - Perhaps you meant middle(x, y)?""",)) + Perhaps you meant mean((x, y))?""")) end Base.reduce_first(+, f_value)/1 end diff --git a/test/runtests.jl b/test/runtests.jl index 6599b46d..caec1ece 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -173,7 +173,7 @@ end @test isnan(@inferred mean(Iterators.filter(x -> true, Float64[]))) # using a number as a "function" - @test_throws "ArgumentError: mean(f, itr) requires a function and an iterable.\nPerhaps you meant middle(x, y)" mean(1, 2) + @test_throws "ArgumentError: mean(f, itr) requires a function and an iterable.\nPerhaps you meant mean((x, y))" mean(1, 2) struct T <: Number x::Int end