[#106341] [Ruby master Bug#18369] users.detect(:name, "Dorian") as shorthand for users.detect { |user| user.name == "Dorian" } — dorianmariefr <noreply@...>
Issue #18369 has been reported by dorianmariefr (Dorian Mari辿).
14 messages
2021/11/30
[#106351] [Ruby master Bug#18371] Release branches (release information in general) — "tenderlovemaking (Aaron Patterson)" <noreply@...>
Issue #18371 has been reported by tenderlovemaking (Aaron Patterson).
7 messages
2021/11/30
[ruby-core:106293] [Ruby master Bug#18250] Anonymous variables seem to break `Ractor.make_shareable`
From:
"byroot (Jean Boussier)" <noreply@...>
Date:
2021-11-26 16:54:13 UTC
List:
ruby-core #106293
Issue #18250 has been updated by byroot (Jean Boussier).
Sorry I meant `334b69e5042f47f89c8780c1d7efa32d70c84786` (https://github.com/ruby/ruby/commit/334b69e5042f47f89c8780c1d7efa32d70c84786)
----------------------------------------
Bug #18250: Anonymous variables seem to break `Ractor.make_shareable`
https://bugs.ruby-lang.org/issues/18250#change-94918
* Author: tenderlovemaking (Aaron Patterson)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-darwin20]
* Backport: 2.7: DONTNEED, 3.0: REQUIRED
----------------------------------------
The following code breaks with a strange error:
```ruby
def foo(*); ->{ super };end
Ractor.make_shareable(foo) # expected Symbol
```
Output:
```
[aaron@tc ~/g/ruby (master)]$ cat test.rb
def foo(*); ->{ super };end
Ractor.make_shareable(foo) # expected Symbol
[aaron@tc ~/g/ruby (master)]$ ruby test.rb
<internal:ractor>:816:in `make_shareable': wrong argument type false (expected Symbol) (TypeError)
from test.rb:2:in `<main>'
[aaron@tc ~/g/ruby (master)]$
```
The reason is because the `*` parameter has no name, but Ractor tries to find the name so it can make an exception.
I *expect* the above program to raise an `Ractor::IsolationError`, but instead it raises a `TypeError`.
I've attached a patch that fixes this bug.
---Files--------------------------------
0001-Give-params-a-name.patch (3.33 KB)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>