* [ruby-dev:47975] [ruby-trunk - Bug #9526] [Open] Method#owner returns wrong owner if using prepend.
[not found] <redmine.issue-9526.20140217142450@ruby-lang.org>
@ 2014-02-17 14:24 ` spiketeika
2014-02-18 1:30 ` [ruby-dev:47976] [ruby-trunk - Bug #9526] " shugo
` (4 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: spiketeika @ 2014-02-17 14:24 UTC (permalink / raw
To: ruby-dev
Issue #9526 has been reported by Kaneko Yuichiro.
----------------------------------------
Bug #9526: Method#owner returns wrong owner if using prepend.
https://bugs.ruby-lang.org/issues/9526
* Author: Kaneko Yuichiro
* Status: Open
* Priority: Normal
* Assignee:
* Category:
* Target version:
* ruby -v: ruby-2.0.0-p353 [ x86_64 ] & ruby-2.1.0 [ x86_64 ]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
rdoc indicates that Method#owner will return a class or module that defines a method.
http://www.ruby-doc.org/core-2.0/Method.html#method-i-owner
-------------------
module MyMod
def x(y)
super(y*y)
end
end
class Blah
def x(y)
y + 1
end
prepend MyMod
end
Blah.new.method(:x).owner
\# => MyMod
--------------------
In this case, a class or module that defines a method is Blah.
So I think Blah.new.method(:x).owner should return Blah.
--
http://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-dev:47976] [ruby-trunk - Bug #9526] Method#owner returns wrong owner if using prepend.
[not found] <redmine.issue-9526.20140217142450@ruby-lang.org>
2014-02-17 14:24 ` [ruby-dev:47975] [ruby-trunk - Bug #9526] [Open] Method#owner returns wrong owner if using prepend spiketeika
@ 2014-02-18 1:30 ` shugo
2014-02-18 1:30 ` [ruby-dev:47977] [ruby-trunk - Bug #9526] [Feedback] " shugo
` (3 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: shugo @ 2014-02-18 1:30 UTC (permalink / raw
To: ruby-dev
Issue #9526 has been updated by Shugo Maeda.
Kaneko Yuichiro wrote:
> In this case, a class or module that defines a method is Blah.
> So I think Blah.new.method(:x).owner should return Blah.
I don't catch your point.
`Blah.new.x(1)` calls MyMod#x, so `Blah.new.method(:x).owner` should return MyMod, shouldn't it?
----------------------------------------
Bug #9526: Method#owner returns wrong owner if using prepend.
https://bugs.ruby-lang.org/issues/9526#change-45224
* Author: Kaneko Yuichiro
* Status: Open
* Priority: Normal
* Assignee:
* Category:
* Target version:
* ruby -v: ruby-2.0.0-p353 [ x86_64 ] & ruby-2.1.0 [ x86_64 ]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
rdoc indicates that Method#owner will return a class or module that defines a method.
http://www.ruby-doc.org/core-2.0/Method.html#method-i-owner
-------------------
module MyMod
def x(y)
super(y*y)
end
end
class Blah
def x(y)
y + 1
end
prepend MyMod
end
Blah.new.method(:x).owner
\# => MyMod
--------------------
In this case, a class or module that defines a method is Blah.
So I think Blah.new.method(:x).owner should return Blah.
--
http://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-dev:47977] [ruby-trunk - Bug #9526] [Feedback] Method#owner returns wrong owner if using prepend.
[not found] <redmine.issue-9526.20140217142450@ruby-lang.org>
2014-02-17 14:24 ` [ruby-dev:47975] [ruby-trunk - Bug #9526] [Open] Method#owner returns wrong owner if using prepend spiketeika
2014-02-18 1:30 ` [ruby-dev:47976] [ruby-trunk - Bug #9526] " shugo
@ 2014-02-18 1:30 ` shugo
2014-02-18 5:16 ` [ruby-dev:47978] [ruby-trunk - Bug #9526] " boris
` (2 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: shugo @ 2014-02-18 1:30 UTC (permalink / raw
To: ruby-dev
Issue #9526 has been updated by Shugo Maeda.
Status changed from Open to Feedback
----------------------------------------
Bug #9526: Method#owner returns wrong owner if using prepend.
https://bugs.ruby-lang.org/issues/9526#change-45225
* Author: Kaneko Yuichiro
* Status: Feedback
* Priority: Normal
* Assignee:
* Category:
* Target version:
* ruby -v: ruby-2.0.0-p353 [ x86_64 ] & ruby-2.1.0 [ x86_64 ]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
rdoc indicates that Method#owner will return a class or module that defines a method.
http://www.ruby-doc.org/core-2.0/Method.html#method-i-owner
-------------------
module MyMod
def x(y)
super(y*y)
end
end
class Blah
def x(y)
y + 1
end
prepend MyMod
end
Blah.new.method(:x).owner
\# => MyMod
--------------------
In this case, a class or module that defines a method is Blah.
So I think Blah.new.method(:x).owner should return Blah.
--
http://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-dev:47978] [ruby-trunk - Bug #9526] Method#owner returns wrong owner if using prepend.
[not found] <redmine.issue-9526.20140217142450@ruby-lang.org>
` (2 preceding siblings ...)
2014-02-18 1:30 ` [ruby-dev:47977] [ruby-trunk - Bug #9526] [Feedback] " shugo
@ 2014-02-18 5:16 ` boris
2014-02-18 13:46 ` [ruby-dev:47981] " spiketeika
2014-02-19 9:09 ` [ruby-dev:47987] [ruby-trunk - Bug #9526] [Rejected] " shugo
5 siblings, 0 replies; 6+ messages in thread
From: boris @ 2014-02-18 5:16 UTC (permalink / raw
To: ruby-dev
Issue #9526 has been updated by Boris Stitnicky.
Also for me, this is the expected behavior. `MyMod` is prepended before `Blah`, and therefore `Blah.new.method( :x )` is taken from `MyMod`. As soon as you perform `module MyMod; remove_method( :x ) end`, method `x` will be again taken from `Blah`.
----------------------------------------
Bug #9526: Method#owner returns wrong owner if using prepend.
https://bugs.ruby-lang.org/issues/9526#change-45227
* Author: Kaneko Yuichiro
* Status: Feedback
* Priority: Normal
* Assignee:
* Category:
* Target version:
* ruby -v: ruby-2.0.0-p353 [ x86_64 ] & ruby-2.1.0 [ x86_64 ]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
rdoc indicates that Method#owner will return a class or module that defines a method.
http://www.ruby-doc.org/core-2.0/Method.html#method-i-owner
-------------------
module MyMod
def x(y)
super(y*y)
end
end
class Blah
def x(y)
y + 1
end
prepend MyMod
end
Blah.new.method(:x).owner
\# => MyMod
--------------------
In this case, a class or module that defines a method is Blah.
So I think Blah.new.method(:x).owner should return Blah.
--
http://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-dev:47981] [ruby-trunk - Bug #9526] Method#owner returns wrong owner if using prepend.
[not found] <redmine.issue-9526.20140217142450@ruby-lang.org>
` (3 preceding siblings ...)
2014-02-18 5:16 ` [ruby-dev:47978] [ruby-trunk - Bug #9526] " boris
@ 2014-02-18 13:46 ` spiketeika
2014-02-19 9:09 ` [ruby-dev:47987] [ruby-trunk - Bug #9526] [Rejected] " shugo
5 siblings, 0 replies; 6+ messages in thread
From: spiketeika @ 2014-02-18 13:46 UTC (permalink / raw
To: ruby-dev
Issue #9526 has been updated by Kaneko Yuichiro.
Sorry, I misunderstood behavior of prepend. Shugo and Boris are right. Thanks for your quick responce. Please close this ticket :)
----------------------------------------
Bug #9526: Method#owner returns wrong owner if using prepend.
https://bugs.ruby-lang.org/issues/9526#change-45239
* Author: Kaneko Yuichiro
* Status: Feedback
* Priority: Normal
* Assignee:
* Category:
* Target version:
* ruby -v: ruby-2.0.0-p353 [ x86_64 ] & ruby-2.1.0 [ x86_64 ]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
rdoc indicates that Method#owner will return a class or module that defines a method.
http://www.ruby-doc.org/core-2.0/Method.html#method-i-owner
-------------------
module MyMod
def x(y)
super(y*y)
end
end
class Blah
def x(y)
y + 1
end
prepend MyMod
end
Blah.new.method(:x).owner
\# => MyMod
--------------------
In this case, a class or module that defines a method is Blah.
So I think Blah.new.method(:x).owner should return Blah.
--
http://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-dev:47987] [ruby-trunk - Bug #9526] [Rejected] Method#owner returns wrong owner if using prepend.
[not found] <redmine.issue-9526.20140217142450@ruby-lang.org>
` (4 preceding siblings ...)
2014-02-18 13:46 ` [ruby-dev:47981] " spiketeika
@ 2014-02-19 9:09 ` shugo
5 siblings, 0 replies; 6+ messages in thread
From: shugo @ 2014-02-19 9:09 UTC (permalink / raw
To: ruby-dev
Issue #9526 has been updated by Shugo Maeda.
Status changed from Feedback to Rejected
Kaneko Yuichiro wrote:
> Sorry, I misunderstood behavior of prepend. Shugo and Boris are right. Thanks for your quick responce. Please close this ticket :)
Thanks for your confirmation.
----------------------------------------
Bug #9526: Method#owner returns wrong owner if using prepend.
https://bugs.ruby-lang.org/issues/9526#change-45276
* Author: Kaneko Yuichiro
* Status: Rejected
* Priority: Normal
* Assignee:
* Category:
* Target version:
* ruby -v: ruby-2.0.0-p353 [ x86_64 ] & ruby-2.1.0 [ x86_64 ]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
rdoc indicates that Method#owner will return a class or module that defines a method.
http://www.ruby-doc.org/core-2.0/Method.html#method-i-owner
-------------------
module MyMod
def x(y)
super(y*y)
end
end
class Blah
def x(y)
y + 1
end
prepend MyMod
end
Blah.new.method(:x).owner
\# => MyMod
--------------------
In this case, a class or module that defines a method is Blah.
So I think Blah.new.method(:x).owner should return Blah.
--
http://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-02-19 9:18 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <redmine.issue-9526.20140217142450@ruby-lang.org>
2014-02-17 14:24 ` [ruby-dev:47975] [ruby-trunk - Bug #9526] [Open] Method#owner returns wrong owner if using prepend spiketeika
2014-02-18 1:30 ` [ruby-dev:47976] [ruby-trunk - Bug #9526] " shugo
2014-02-18 1:30 ` [ruby-dev:47977] [ruby-trunk - Bug #9526] [Feedback] " shugo
2014-02-18 5:16 ` [ruby-dev:47978] [ruby-trunk - Bug #9526] " boris
2014-02-18 13:46 ` [ruby-dev:47981] " spiketeika
2014-02-19 9:09 ` [ruby-dev:47987] [ruby-trunk - Bug #9526] [Rejected] " shugo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).