Skip to content

Commit

Permalink
Improve safety section on Style/SymbolProc
Browse files Browse the repository at this point in the history
  • Loading branch information
r7kamura authored and bbatsov committed Aug 29, 2022
1 parent 65de62e commit eb29c19
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/rubocop/cop/style/symbol_proc.rb
Expand Up @@ -11,10 +11,11 @@ module Style
# These are customizable with `AllowedMethods` option.
#
# @safety
# This cop is unsafe because ``proc``s and blocks work differently
# when additional arguments are passed in. A block will silently
# allow additional arguments, but a `proc` will raise
# an `ArgumentError`.
# This cop is unsafe because there is a difference that a `Proc`
# generated from `Symbol#to_proc` behaves as a lambda, while
# a `Proc` generated from a block does not.
# For example, a lambda will raise an `ArgumentError` if the
# number of arguments is wrong, but a non-lambda `Proc` will not.
#
# For example:
#
Expand Down

0 comments on commit eb29c19

Please sign in to comment.