
Issue #20216 has been reported by kddnewton (Kevin Newton). ---------------------------------------- Bug #20216: Circular parameter reference not checked for assignment https://bugs.ruby-lang.org/issues/20216 * Author: kddnewton (Kevin Newton) * Status: Open * Priority: Normal * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- I wanted to check if this was a bug or desired. Usually when you reference a parameter within its own default value (optional positional or optional keyword) it raises a syntax error. This is unless you use it in an assignment, in which case it is not checked. Is this desired? Here's an example: ```ruby def foo(bar = bar = 1); end def foo(bar: bar = 1); end ``` I'm not sure what this code is supposed to be doing. I expected it to raise a syntax error. -- https://bugs.ruby-lang.org/