Actions
Bug #20482
closednil variables in a guard clause of a standalone => or in expression
Bug #20482:
nil variables in a guard clause of a standalone => or in expression
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
Description
The following expression produces a TypeError, which is quite unexpected:
x.rb:1:in `*': nil can't be coerced into Integer (TypeError)
[1, 2] in a, b if b == 2*a
^
from x.rb:1:in `<main>'
The expression above should be equivalent to the following one, which works as expected:
Apologies in advance if this is intentional or has been reported before.
Actions