[Runtime] Preserve prototypes assigned before Math::Complex sub definitions
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 57/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Perl
- Star
- 64
- Fork
- 7
- Merge trung bình
- 4 giờ 56 phút
- Pull request đã merge (30 ngày)
- 181
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fglock/PerlOnJava
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
fglock/PerlOnJava#1651 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fglock/PerlOnJava#1579 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:cpan-port area:unicode bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
fglock/PerlOnJava#1341 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 54/100
fglock/PerlOnJava#1671 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:cpan-port enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
fglock/PerlOnJava#1670 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của fglock/PerlOnJava
Issue tương tự
-
FOODTURE
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
openfoodfacts/openfoodfacts-server#14853 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Needs Triage
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 66/100
Perl/perl5#24913 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Perl/Fish oddness in new versionĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
gugod/App-perlbrew#879 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
RotherOSS/otobo#6205 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày