[ruby-core:96294] [Ruby master Feature#16419] FrozenError.new ignores receiver:

[email protected]
Newsgroups gmane.comp.lang.ruby.core
Message-ID <redmine.journal-83197.20191218001132.c1626cea6746c98f@ruby-lang.org>
Issue #16419 has been updated by znz (Kazuhiro NISHIYAMA).

Assignee changed from jeremyevans0 (Jeremy Evans) to matz (Yukihiro Matsumoto)

I added this to https://bugs.ruby-lang.org/issues/16393

----------------------------------------
Feature #16419: FrozenError.new ignores receiver:
https://bugs.ruby-lang.org/issues/16419#change-83197

* Author: znz (Kazuhiro NISHIYAMA)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 
----------------------------------------
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
```



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.