Actions
Bug #21010
closedEndless method definition of `[]=` is SyntaxError in parse.y but allowed in Prism
ruby -v:
ruby 3.5.0dev (2025-01-06T01:50:53Z master c8e3d745fa) +PRISM [x86_64-linux]
Description
These codes is SyntaxError in parse.y but accepted in Prism
def []=(k,v)=1
def obj.[]=(k,v)=1
These are both SyntaxError in parse.y and Prism by design.
# invalid method name; a setter method cannot be defined in an endless method definition
def f=(k,v)=1
def obj.f=(k,v)=1
I think endless method definition of []=
should be also rejected.
Updated by eileencodes (Eileen Uchitelle) 8 days ago
- Assignee set to prism
Updated by eileencodes (Eileen Uchitelle) 8 days ago
Updated by nobu (Nobuyoshi Nakada) 8 days ago
- Status changed from Open to Closed
Updated by nobu (Nobuyoshi Nakada) 8 days ago
- Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED
Actions
Like0
Like0Like0Like0Like0