From: "ko1 (Koichi Sasada)" <noreply@ruby-lang.org>
To: ruby-dev@ruby-lang.org
Subject: [ruby-dev:51127] [Ruby master Bug#14817] TracePoint#parameters for bmethod's return event should return the same value as its Method#parameters
Date: Tue, 14 Dec 2021 17:15:32 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-95346.20211214171531.3007@ruby-lang.org> (raw)
In-Reply-To: <redmine.issue-14817.20180603144747.3007@ruby-lang.org>
Issue #14817 has been updated by ko1 (Koichi Sasada).
Status changed from Assigned to Closed
fixed https://github.com/ruby/ruby/pull/4637
----------------------------------------
Bug #14817: TracePoint#parameters for bmethod's return event should return the same value as its Method#parameters
https://bugs.ruby-lang.org/issues/14817#change-95346
* Author: ktsj (Kazuki Tsujimoto)
* Status: Closed
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* ruby -v: ruby 2.6.0dev (2018-06-03 master 63562) [x86_64-linux]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
define_methodしたメソッド(bmethod)のcall/returnイベント中にTracePoint#parametersを呼び出すと
以下の結果となります。
```
$ cat t.rb
define_method(:bm) {|a|}
p method_parameters: method(:bm).parameters
trace = TracePoint.new(:call, :return){|tp|
mid = tp.method_id
if mid == :bm
p mid: mid, event: tp.event, tp_parameters: tp.parameters
end
}
trace.enable{
bm(0)
}
$ ruby -v t.rb
ruby 2.6.0dev (2018-06-03 master 63562) [x86_64-linux]
{:method_parameters=>[[:req, :a]]}
{:mid=>:bm, :event=>:call, :tp_parameters=>[[:req, :a]]}
{:mid=>:bm, :event=>:return, :tp_parameters=>[]} #=> expected: {:mid=>:bm, :event=>:return, :tp_parameters=>[[:req, :a]]}
```
現状、callイベントに限ってその戻り値がbmethodのMethod#parametersの呼び出し結果と一致しますが
returnイベント時も同様となるべきだと思います。
--
https://bugs.ruby-lang.org/
prev parent reply other threads:[~2021-12-14 17:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-14817.20180603144747.3007@ruby-lang.org>
2021-06-18 21:14 ` [ruby-dev:51067] " merch-redmine
2021-12-14 17:15 ` ko1 (Koichi Sasada) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-95346.20211214171531.3007@ruby-lang.org \
--to=noreply@ruby-lang.org \
--cc=ruby-dev@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).