rbs icon indicating copy to clipboard operation
rbs copied to clipboard

Using keywords as identifiers

Open hurricup opened this issue 3 years ago • 1 comments

According to recent sigs update: https://github.com/ruby/rbs/blob/master/sig/polyfill.rbs#L31 some keywords may be used as identifiers. IRR it was not possible in the old lexer/parser. Is there some official position on this and which keywords may/may not be used as identifiers.

hurricup avatar Feb 02 '22 09:02 hurricup

Hi @hurricup! 👋

Yes, the parser now allows having keyword for method names, keyword names, and argument names. I don't think prohibiting them doesn't make much sense. So, I don't have a plan to revert them now.

It is intentional for method names and keyword names because they are allowed in Ruby. (Argument names are accidentally, in fact...)

soutaro avatar Feb 02 '22 11:02 soutaro