Found here: shards/test/integration/update_test.cr
With 0.24.2:
$ crystal tool format ./test/integration/update_test.cr --check
Error: couldn't format './test/integration/update_test.cr', please report a bug...
Reproducible code:
def with_shard(metadata, &block)
yield
end
with_shard("hello", ) do
puts "world"
end
With master (2d93603d4):
$ ./bin/crystal tool format a.cr --check
Using compiled compiler at `.build/crystal'
Error: couldn't format 'a.cr', please report a bug...
Is it a formatter bug, should example above compile in the first place?
It compiles, and I think that is okay. It doesn't do any harm and array and hash literals accept trailing commas as well.
But the formatter should probably remove it (and obviously not fall over it).
Just to clarify: A comma after a block argument (foo(&block, )) neither compiles nor formats because it is a syntax error. And that sound right.
Most helpful comment
Just to clarify: A comma after a block argument (
foo(&block, )) neither compiles nor formats because it is a syntax error. And that sound right.