[#102652] [Ruby master Bug#17664] Behavior of sockets changed in Ruby 3.0 to non-blocking — ciconia@...
Issue #17664 has been reported by ciconia (Sharon Rosner).
23 messages
2021/02/28
[ruby-core:102469] [Ruby master Bug#17623] endless def can access to outer local variables and lead to unexpected result
From:
mame@...
Date:
2021-02-12 11:06:16 UTC
List:
ruby-core #102469
Issue #17623 has been updated by mame (Yusuke Endoh).
I cannot reproduce the issue.
```
$ ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
$ irb
irb(main):001:0* a = 1
=> 1
irb(main):002:1* def f = a
=> :f
irb(main):003:0> f
Traceback (most recent call last):
5: from /home/mame/local/bin/irb:23:in `<main>'
4: from /home/mame/local/bin/irb:23:in `load'
3: from /home/mame/local/lib/ruby/gems/3.0.0/gems/irb-1.3.0/exe/irb:11:in `<top (required)>'
2: from (irb):3:in `<main>'
1: from (irb):2:in `f'
NameError (undefined local variable or method `a' for main:Object)
irb(main):004:0>
$ ruby
a = 1
def f = a
f
-:2:in `f': undefined local variable or method `a' for main:Object (NameError)
from -:3:in `<main>'
```
Does your `.irbrc` have something?
----------------------------------------
Bug #17623: endless def can access to outer local variables and lead to unexpected result
https://bugs.ruby-lang.org/issues/17623#change-90357
* Author: UlyssesZhan (有丘 詹)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
``` ruby
irb(main):001:0> a = 1
=> 1
irb(main):002:0> def f = a
=> :f
irb(main):003:0> f
=> "D:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/irb-1.3.0/exe/irb"
```
I have not idea what it means.
The codes just work fine outside irb.
Maybe it is a bug.
--
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>