From 9c7db21735645fab0b2421fc9eaad212b7af57d9 Mon Sep 17 00:00:00 2001 From: Moelf Date: Wed, 17 Jun 2020 08:08:21 -0700 Subject: [PATCH 1/3] fix 1d/2d array method error message with unsupported keyword arg --- base/errorshow.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/errorshow.jl b/base/errorshow.jl index 9042d40b5c949..54a8cb6d01cb4 100644 --- a/base/errorshow.jl +++ b/base/errorshow.jl @@ -316,7 +316,7 @@ function showerror(io::IO, ex::MethodError) hasrows |= isrow push!(vec_args, isrow ? vec(arg) : arg) end - if hasrows && applicable(f, vec_args...) + if hasrows && applicable(f, vec_args...) && isempty(kwargs) print(io, "\n\nYou might have used a 2d row vector where a 1d column vector was required.", "\nNote the difference between 1d column vector [1,2,3] and 2d row vector [1 2 3].", "\nYou can convert to a column vector with the vec() function.") From 53d133521b5978b5c3a8e27f7311b5a2a9ca11e6 Mon Sep 17 00:00:00 2001 From: Moelf Date: Sat, 5 Sep 2020 21:05:23 -0400 Subject: [PATCH 2/3] fix 1d/2d error --- test/errorshow.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/errorshow.jl b/test/errorshow.jl index 78e48bf42e2c8..37861ed3ee0ca 100644 --- a/test/errorshow.jl +++ b/test/errorshow.jl @@ -750,3 +750,12 @@ end @test contains(bt_str, "@ $m.B.C") @test contains(bt_str, "@ $m.B.D") end +# 1d/2d error shouldn't appear in unsupported keywords arg #36325 +let err = nothing + try + identity([1,1]; bad_kwards = :julia) + catch err + err_str = sprint(showerror, err) + @test !occursin("2d", err_str) + end +end From 3683b5e4019940b69ac3f93ce3ea3903036ffac8 Mon Sep 17 00:00:00 2001 From: Jerry Ling Date: Wed, 18 Nov 2020 23:46:23 -0500 Subject: [PATCH 3/3] Update test/errorshow.jl Co-authored-by: Jeff Bezanson --- test/errorshow.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/errorshow.jl b/test/errorshow.jl index 37861ed3ee0ca..57565e9f56d63 100644 --- a/test/errorshow.jl +++ b/test/errorshow.jl @@ -753,7 +753,7 @@ end # 1d/2d error shouldn't appear in unsupported keywords arg #36325 let err = nothing try - identity([1,1]; bad_kwards = :julia) + identity([1 1]; bad_kwards = :julia) catch err err_str = sprint(showerror, err) @test !occursin("2d", err_str)