rubocop / rubocop

A Ruby static code analyzer and formatter, based on the community Ruby style guide.

Home Page:https://docs.rubocop.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cop idea: Disallow having `yield` in a `lambda`

boris-petrov opened this issue · comments

Is your feature request related to a problem? Please describe.

Ruby disallows that and blows up with a syntax error. At least JRuby does that. Not sure what MRI does.

I was surprised to see that RuboCop passes with a file containing that.

Describe the solution you'd like

A cop that flags that as an error.

Describe alternatives you've considered

None.

Additional context

Stack Overflow thread.