You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ruby2Ruby incorrectly changes the behavior of the following input code:
defined?(NotDefined) ? 1 : 2# => 1
The incorrect output is this:
defined?NotDefined ? 1 : 1# => "expression"
While the omission of parentheses would be correct if defined? was a method, it is a keyword with a different precendence. With added parentheses the emitted code works like this:
defined?(NotDefined ? 1 : 1)# => "expression"
I believe this is an issue with ruby2ruby instead of ruby_parser, as the parsed AST looks correct:
Ruby2Ruby incorrectly changes the behavior of the following input code:
The incorrect output is this:
While the omission of parentheses would be correct if
defined?
was a method, it is a keyword with a different precendence. With added parentheses the emitted code works like this:I believe this is an issue with ruby2ruby instead of ruby_parser, as the parsed AST looks correct:
The text was updated successfully, but these errors were encountered: