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

未关闭 适合新手
#2,024 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
88/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
perl
领域
backend

调研方向

检查 src/main/perl/lib/IO/Handle.pm 中第301行和第501行附近报告的调用。将两个内置函数调用都限定为 CORE::close($fh),同时保留 DESTROY 的清理行为,然后在 JVM 和解释器后端上启用警告并加载 IO::Handle。加载模块时不产生歧义警告即为完成。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Perl
星标
67
派生
8
平均合并
6 小时 14 分钟
30 天内合并 PR
143

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

fglock/PerlOnJava 的其他 Issue

查看 fglock/PerlOnJava 的全部 Issue

相似的 Issue

更多 Perl Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。