Open
Description
This seems unrelated to #371 even though the exception looks the same.
# no_anomymous_block_parameter.rb
def foo
bar(&)
end
# reproduce.rb
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "rake"
gem "syntax_tree"
end
require "syntax_tree/rake_tasks"
SyntaxTree::Rake::CheckTask.new("check") do |t|
t.source_files = FileList["no_anomymous_block_parameter.rb"]
end
Rake::Task["check"].invoke
$ ruby --version
ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin22]
$ ruby reproduce.rb
[warn] foo.rb
private method `format' called for nil:NilClass
~/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/syntax_tree-6.2.0/lib/syntax_tree.rb:94:in `format_node'
~/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/syntax_tree-6.2.0/lib/syntax_tree.rb:66:in `format'
~/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/syntax_tree-6.2.0/lib/syntax_tree/cli.rb:136:in `run'
~/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/syntax_tree-6.2.0/lib/syntax_tree/cli.rb:671:in `block (2 levels) in process_queue'
The listed files did not match the expected format.
$ ruby foo.rb
foo.rb: --> foo.rb
no anonymous block parameter
1 def foo
> 2 bar(&)
3 end
foo.rb:2: no anonymous block parameter (SyntaxError)
Metadata
Metadata
Assignees
Labels
No labels