[ruby-core:95799] [Ruby master Bug#16343] Inconsistent behavior of 'circular argument reference' error
From:
ibylich@...
Date:
2019-11-11 18:28:01 UTC
List:
ruby-core #95799
Issue #16343 has been reported by ibylich (Ilya Bylich).
----------------------------------------
Bug #16343: Inconsistent behavior of 'circular argument reference' error
https://bugs.ruby-lang.org/issues/16343
* Author: ibylich (Ilya Bylich)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.7.0dev (2019-11-04T16:32:26Z trunk a087e027bf) [x86_64-darwin19]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
The following code gives a syntax error:
``` ruby
m { |foo = proc { || foo }| }
# => SyntaxError (-e:14: circular argument reference - foo)
```
But this code is valid:
``` ruby
m { |foo = proc { |bar| foo }| }
```
Is it intentional? `foo` becomes a proc that returns itself, so there must be a circular dependency
--
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>