Project

General

Profile

Bug #20111

Updated by andrykonchin (Andrew Konchin) 11 months ago

`defined?` doesn't consider &&=, ||= and other ...= operators as `assignment`: 

 ```ruby 
 defined?(A::B += 1) # => "expression" 
 defined?(A::B &&= true) # => "expression" 
 defined?(A::B ||= true) # => "expression" 
 ``` 

 But considers consider as `assignment` ordinal assignment: 

 ```ruby 
 defined?(A::B = 1) # => "assignment" 
 ``` 

 Wondering if it's expected behaviour.

Back