[IO::Handle] Qualify builtin close calls to avoid load-time warnings

Đang mở Phù hợp với người mới
#2,024 0 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ó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
88/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ệ
perl
Lĩnh vực
backend

Hướng nghiên cứu

Kiểm tra src/main/perl/lib/IO/Handle.pm tại các lệnh gọi được báo cáo quanh dòng 301 và 501. Ghi rõ cả hai lệnh gọi builtin thành CORE::close($fh) trong khi vẫn giữ nguyên hành vi dọn dẹp của DESTROY, sau đó nạp IO::Handle với cảnh báo được bật trên cả backend JVM lẫn backend trình thông dịch. Hoàn tất khi việc nạp mô-đun không phát ra cảnh báo nhập nhằng nào.

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

Mô tả

area:io area:warnings bug

Summary

Loading the bundled IO::Handle module emits two ambiguous warnings even though both calls are intended to invoke Perl's builtin close:

use warnings;
require IO::Handle;

PerlOnJava reports warnings at src/main/perl/lib/IO/Handle.pm lines 301 and 501. The module defines IO::Handle::close earlier (line 86), so these later bare close($fh) calls are ambiguous. The comment at line 298 already describes the intended operation as CORE::close, but the call is not qualified. The DESTROY call also needs explicit builtin qualification while preserving deterministic handle cleanup.

Expected and actual behavior

Expected: requiring IO::Handle produces no warnings.

Actual on PerlOnJava, with both JVM and interpreter backends:

Ambiguous call resolved as CORE::close(), qualify as such or use & at jar:PERL5LIB/IO/Handle.pm line 301.
Ambiguous call resolved as CORE::close(), qualify as such or use & at jar:PERL5LIB/IO/Handle.pm line 501.

System Perl 5.42.2 loads its core IO::Handle without warnings. Its DESTROY is defined before close, and it has no later bare calls to that builtin.

This caused Data-Message-Board 0.06, CPAN random run 20261109-091152-39587, to fail t/Test-Shared-Fixture-Data-Message-Board-Example/01-use.t (no warnings): 1 of 75 tests failed on PerlOnJava. The complete suite passed 75/75 under the archived system-Perl oracle.

Environment and source

  • PerlOnJava source: 4aca25e9fc5ebe26fb0081173a0cc9e3339c9c60
  • OpenJDK 24.0.2, macOS arm64
  • System Perl: 5.42.2

Qualify the two builtin calls as CORE::close($fh) and retain the existing DESTROY cleanup behavior.

Ngôn ngữ chính
Perl
Star
67
Fork
8
Merge trung bình
6 giờ 14 phút
Pull request đã merge (30 ngày)
143

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.