Actions
Bug #20111
closed`defined?` returns `expression` for assignment operators combined with fully qualified constants
Bug #20111:
`defined?` returns `expression` for assignment operators combined with fully qualified constants
Updated by Eregon (Benoit Daloze) over 2 years ago
At least it seems inconsistent with defined?(A += 1) and defined?(a += 1) which are both "assignment"
Updated by andrykonchin (Andrew Konchin) over 2 years ago
- Description updated (diff)
Updated by jeremyevans0 (Jeremy Evans) over 2 years ago
I submitted a pull request to fix this: https://github.com/ruby/ruby/pull/9476
Updated by jeremyevans (Jeremy Evans) over 2 years ago
- Status changed from Open to Closed
Applied in changeset git|ef751252711ca7ecabb3e4ad9214fa0d1d63608a.
Make defined? for op asgn expressions to constants use "assignment"
Previously, it used "expression", as that was the default. However,
op asgn expressions to constants use the NODE_OP_CDECL, so recognize
that node type as assignement.
Fixes [Bug #20111]
Updated by ko1 (Koichi Sasada) over 2 years ago
Just curious, who cares the difference?
Updated by Eregon (Benoit Daloze) over 2 years ago
@ko1 (Koichi Sasada) Just inconsistency discovered while implementing defined? for these various constructs.
Actions