[Runtime] Preserve prototypes assigned before Math::Complex sub definitions
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 57/100
調査の方向性
Start with the prototype handling for forward subs and later body definitions, then add the focused regression test requested in the issue. Verify that the assigned prototype is preserved without a mismatch warning, matching system Perl. Finally, run Template-Toolkit's t/math_rand.t on PerlOnJava and confirm it passes without unrelated warnings.
索引モデルが issue の本文から書いたものです。
説明
Summary
Loading core Math::Complex emits six false Prototype mismatch warnings, causing Template-Toolkit's t/math_rand.t warning assertion to fail.
Reproduction and evidence
On PerlOnJava commit 3893a1903799d49a4c0733bf231468bb6087cc13 (the PR base) and PR head 45c7c70903a79ab5ecbdbcc0c5a018613ef0b4a2, run:
timeout 1800 ./jcpan -t Template
Template-Toolkit 3.106 fails only t/math_rand.t (1 of 1 assertion). The assertion expects no warnings while calling rand/srand without arguments, but receives warnings such as Prototype mismatch: sub Math::Complex::abs (_) vs none at .../Math/Complex.pm line 694. The same failure and warning text reproduce on the pre-PR base, so this is independent of the MakeMaker changes in PR #1654.
The core src/main/perl/lib/Math/Complex.pm sets _ prototypes for abs, cos, exp, log, sin, and sqrt via Scalar::Util::set_prototype in its BEGIN block (around lines 99–106), then defines those subroutines without inline prototypes later in the file (for example sub abs {} around line 676). PerlOnJava treats the later body definitions as replacing the already-prototyped forward CV with a prototype-less CV and emits the (_) vs none mismatch warning. Perl preserves the prototype assigned to that CV; the definition should not clear it or warn.
Expected behavior
The six intentional Math::Complex overrides should retain their _ prototype without emitting mismatch warnings. Template's t/math_rand.t should see no unrelated warnings from loading Math::Complex.
Acceptance criteria
- Add a focused regression test for assigning a prototype to a forward sub and then defining its body without an inline prototype.
- Preserve the assigned prototype and avoid a false mismatch warning, matching system Perl.
- Confirm
Template::Toolkit'st/math_rand.tpasses on PerlOnJava.
- 主要言語
- Perl
- スター
- 64
- フォーク
- 7
- 平均マージ
- 4時間 56分
- マージ済み PR(30日)
- 181
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fglock/PerlOnJava のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
fglock/PerlOnJava#1651 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fglock/PerlOnJava#1579 ·
メンテナーはふだん 1 日以内に返信
-
area:cpan-port area:unicode bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
fglock/PerlOnJava#1341 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 1〜2日 初心者へのやさしさ 54/100
fglock/PerlOnJava#1671 ·
メンテナーはふだん 1 日以内に返信
-
area:cpan-port enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
fglock/PerlOnJava#1670 ·
メンテナーはふだん 1 日以内に返信
fglock/PerlOnJava の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
gugod/App-perlbrew#879 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
RotherOSS/otobo#6205 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add IO::Pipe classオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
yuki-kimoto/SPVM-IO#30 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
RotherOSS/servicecatalog#28 ·