Actions
Bug #16343
closedInconsistent behavior of 'circular argument reference' error
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.0dev (2019-11-04T16:32:26Z trunk a087e027bf) [x86_64-darwin19]
Backport:
Description
The following code gives a syntax error:
m { |foo = proc { || foo }| }
# => SyntaxError (-e:14: circular argument reference - foo)
But this code is valid:
m { |foo = proc { |bar| foo }| }
Is it intentional? foo
becomes a proc that returns itself, so there must be a circular dependency
Actions
Like0
Like0Like0Like0