Project

General

Profile

Actions

Bug #18753

closed

lineno= is not returning an integer

Added by buzztaiki (Taiki Sugawara) almost 2 years ago. Updated almost 2 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:108390]

Description

The call-seq for argf_set_lineno says it returns an integer, but in fact it returns nil.

https://github.com/ruby/ruby/blob/84f410e5e64a2480a86de7c50f01f01f71816435/io.c#L9330

p ARGF.send(:lineno=, 1)
nil

For IO, the input integer value is returned as documented.

p File.open(__FILE__).send(:lineno=, 1)
1

I think ARGF should also return the input value.
I think it is so trivial, but I'm having a little trouble with (adding ARGF to rbs)[https://github.com/ruby/rbs/pull/975].

Updated by buzztaiki (Taiki Sugawara) almost 2 years ago

Ah.. I missed link markup...

Updated by nobu (Nobuyoshi Nakada) almost 2 years ago

The document says that the value of assignment expressions is the RHS.
This is not a method spec, but a language spec.
The value of attribute setter methods have no meaning.

Updated by nobu (Nobuyoshi Nakada) almost 2 years ago

I think the result of setter methods don’t need/shouldn’t to be documented in each methods.

Updated by buzztaiki (Taiki Sugawara) almost 2 years ago

I see. Thank you for your comments.

Actions #5

Updated by jeremyevans0 (Jeremy Evans) almost 2 years ago

  • Status changed from Open to Rejected
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0