[#106355] [Ruby master Bug#18373] RBS build failure: '/include/x86_64-linux/ruby/config.h', needed by 'constants.o'. — "vo.x (Vit Ondruch)" <noreply@...>
Issue #18373 has been reported by vo.x (Vit Ondruch).
28 messages
2021/12/01
[ruby-core:106748] [Ruby master Bug#18408] Rightward assignment into instance variable
From:
"palkan (Vladimir Dementyev)" <noreply@...>
Date:
2021-12-20 18:34:46 UTC
List:
ruby-core #106748
Issue #18408 has been updated by palkan (Vladimir Dementyev).
This worked originally (when this feature was called "rightward assignment"). But since it has been transformed into a pattern match (in the final 3.0 release), we lost the ability to assign to anything but local vars—that's what pattern matching variable binding supports.
I think, it worth to consider adding support for other vars binding in pattern matching in general. Another example:
```ruby
case {name: "John", age: 42}
in name: /jo/ => @name, age: @age
end
puts [@name, @age] #=> ["John", 42]
```
----------------------------------------
Bug #18408: Rightward assignment into instance variable
https://bugs.ruby-lang.org/issues/18408#change-95445
* Author: Dan0042 (Daniel DeLorme)
* Status: Open
* Priority: Normal
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
I expected this to work:
```ruby
42 => @v
```
But instead it raises "syntax error, unexpected instance variable"
Is this intentional?
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>