Skip to content

Commit

Permalink
show warning for unused block
Browse files Browse the repository at this point in the history
With verbopse mode (-w), the interpreter shows a warning if
a block is passed to a method which does not use the given block.

Warning on:

* the invoked method is written in C
* the invoked method is not `initialize`
* not invoked with `super`
* the first time on the call-site with the invoked method
  (`obj.foo{}` will be warned once if `foo` is same method)

[Feature #15554]

`Primitive.attr! :use_block` is introduced to declare that primitive
functions (written in C) will use passed block.

For minitest, test needs some tweak, so use
minitest/minitest@ea9caaf
for `test-bundled-gems`.
  • Loading branch information
ko1 authored and hsbt committed Apr 18, 2024
1 parent 3ecf346 commit dd493df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rdoc/context.rb
Expand Up @@ -710,7 +710,7 @@ def display(method_attr) # :nodoc:
# This method exists to make it easy to work with Context subclasses that
# aren't part of RDoc.

def each_ancestor # :nodoc:
def each_ancestor(&_) # :nodoc:
end

##
Expand Down

0 comments on commit dd493df

Please sign in to comment.