Emit constant-subroutine redefinition warning for equal cached values

Đang mở
#2,075 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
55/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java, perl
Lĩnh vực
backend, testing

Hướng nghiên cứu

Start by reading RuntimeGlob and tracing isSameCachedConstant through the wrapper identity and cached scalar value checks. Add project owned regression coverage for the reported redefinition and same wrapper re-export cases, and first verify the expected warning behavior with standard Perl. Done means one warning on both PerlOnJava backends for replacement by a distinct wrapper with an equal cached value, and no spurious warning when re-exporting the same wrapper.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area:runtime area:warnings bug

Summary

PerlOnJava misses Perl's constant-subroutine redefinition warning when a newly installed constant wrapper has the same cached return value as the previous wrapper.

Evidence

The Constant-Export-Lazy 0.17 test suite passed all 123 tests under system Perl 5.42.2. In CPAN random-tester run 20261116-130945-12232, PerlOnJava failed 2 of 15 assertions in t/private_name_munger.t on both the JVM and interpreter backends.

The test imports BLAH once, changes the private-name mapping, and imports BLAH again. It expects one warning matching Constant subroutine main::BLAH redefined; PerlOnJava reports no warning. The other assertions in the test pass.

Investigation clue

RuntimeGlob suppresses a redefinition warning when isSameCachedConstant considers the old and new constant wrappers equivalent by their cached scalar values. This case suggests that equal returned values do not make distinct constant subroutine definitions equivalent for Perl's redefinition-warning behavior. Please verify the wrapper identity and cached-value path while fixing it.

Acceptance criteria

  • The focused behavior emits one Constant subroutine main::BLAH redefined warning on both PerlOnJava backends.
  • Re-exporting the same constant wrapper without replacing its definition does not introduce a spurious warning.
  • Add project-owned regression coverage and validate its standard Perl behavior before using it to drive the fix.
Ngôn ngữ chính
Perl
Star
67
Fork
8
Merge trung bình
5 giờ 12 phút
Pull request đã merge (30 ngày)
131

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fglock/PerlOnJava

Tất cả issue của fglock/PerlOnJava

Issue tương tự

Thêm issue về Perl

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.