Project

General

Profile

Actions

Feature #16419

closed

FrozenError.new ignores receiver:

Added by znz (Kazuhiro NISHIYAMA) almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Target version:
-
[ruby-core:96227]

Description

Other exception classes with receiver accept recevier as keyword argument of new.
But FrozenError.new accept as positional argument.
I think keyword argument is better consistency.

% git grep 'receiver[:=]' ../error.c
../error.c: *   FrozenError.new(msg=nil, receiver=nil)  -> name_error
../error.c: *   NameError.new(msg=nil, name=nil, receiver: nil)  -> name_error
../error.c: *    [1, 2, 3].method(:rject) # NameError with name "rject" and receiver: Array
../error.c: *    [1, 2, 3].singleton_method(:rject) # NameError with name "rject" and receiver: [1, 2, 3]
../error.c: *   NoMethodError.new(msg=nil, name=nil, args=nil, private=false, receiver: nil)  -> no_method_error
../error.c: *   KeyError.new(message=nil, receiver: nil, key: nil) -> key_error

Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #15751: Add FrozenError#receiverClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0