File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
src/compiler/crystal/semantic Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -271,6 +271,24 @@ describe "Semantic: macro" do
271271 CRYSTAL
272272 end
273273
274+ it " errors if find macros but missing argument" do
275+ assert_error(<<-CRYSTAL , "wrong number of arguments for macro 'foo' (given 0, expected 1)")
276+ macro foo(x)
277+ 1
278+ end
279+
280+ foo
281+ CRYSTAL
282+
283+ assert_error(<<-CRYSTAL , "wrong number of arguments for macro 'foo' (given 0, expected 1)")
284+ private macro foo(x)
285+ 1
286+ end
287+
288+ foo
289+ CRYSTAL
290+ end
291+
274292 describe " raise" do
275293 describe " inside macro" do
276294 describe " without node" do
Original file line number Diff line number Diff line change @@ -902,7 +902,6 @@ class Crystal::Call
902902
903903 macros = in_macro_target & .lookup_macros(def_name)
904904 return unless macros.is_a?(Array (Macro ))
905- macros = macros.reject & .visibility.private?
906905
907906 if msg = single_def_error_message(macros, named_args)
908907 raise msg
You can’t perform that action at this time.
0 commit comments