File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -194,10 +194,7 @@ JL_DLLEXPORT void JL_NORETURN jl_eof_error(void)
194
194
// get kwsorter field, with appropriate error check and message
195
195
JL_DLLEXPORT jl_value_t * jl_get_keyword_sorter (jl_value_t * f )
196
196
{
197
- jl_methtable_t * mt = jl_gf_mtable (f );
198
- if (mt -> kwsorter == NULL )
199
- jl_errorf ("function %s does not accept keyword arguments" , jl_symbol_name (mt -> name ));
200
- return mt -> kwsorter ;
197
+ return jl_get_kwsorter (jl_typeof (f ));
201
198
}
202
199
203
200
JL_DLLEXPORT void jl_typeassert (jl_value_t * x , jl_value_t * t )
Original file line number Diff line number Diff line change 357
357
# issue #33026
358
358
using InteractiveUtils
359
359
@test (@which kwf1 (1 , tens= 2 )). line > 0
360
+
361
+ no_kw_args (x:: Int ) = 0
362
+ @test_throws MethodError no_kw_args (1 , k= 1 )
363
+ @test_throws MethodError no_kw_args (" " , k= 1 )
Original file line number Diff line number Diff line change 87
87
(::Task)(::UInt8, ::UInt16, ::UInt32) = 2
88
88
89
89
# issue 16471 (capturing references to a kwfunc)
90
- Test.@test_throws ErrorException Core.kwfunc (Base.nothing )
90
+ Test.@test !isdefined (Base.Nothing.name.mt, :kwsorter )
91
91
Base.nothing(::UInt8, ::UInt16, ::UInt32; x = 52) = x
92
92
const nothingkw = Core.kwfunc(Base.nothing)
93
93
165
165
const a31488 = fill(String(_v31488), 100)
166
166
end
167
167
""" )
168
- @test_throws ErrorException Core. kwfunc (Base. nothing ) # make sure `nothing` didn't have a kwfunc (which would invalidate the attempted test)
168
+ # make sure `nothing` didn't have a kwfunc (which would invalidate the attempted test)
169
+ @test ! isdefined (Base. Nothing. name. mt, :kwsorter )
169
170
170
171
# Issue #12623
171
172
@test __precompile__ (false ) === nothing
You can’t perform that action at this time.
0 commit comments