Actions
Bug #20216
closedCircular parameter reference not checked for assignment
Description
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:
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.
Updated by nobu (Nobuyoshi Nakada) 3 months ago
They are not "reference"s, I think.
Updated by kddnewton (Kevin Newton) 29 days ago
- Status changed from Open to Closed
Actions
Like0
Like0Like0