[IO::Handle] Qualify builtin close calls to avoid load-time warnings
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
检查 src/main/perl/lib/IO/Handle.pm 中第301行和第501行附近报告的调用。将两个内置函数调用都限定为 CORE::close($fh),同时保留 DESTROY 的清理行为,然后在 JVM 和解释器后端上启用警告并加载 IO::Handle。加载模块时不产生歧义警告即为完成。
由索引模型根据 Issue 内容生成。
描述
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 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fglock/PerlOnJava 的其他 Issue
-
area:runtime documentation enhancement
难度 2/5 1-3 小时 新手友好度 72/100
fglock/PerlOnJava#1579 ·
维护者通常 1 天内回复
-
area:parser bug
难度 4/5 3-5 天 新手友好度 56/100
fglock/PerlOnJava#2027 ·
维护者通常 1 天内回复
-
area:backend area:io area:runtime bug
难度 4/5 3-5 天 新手友好度 45/100
fglock/PerlOnJava#2023 ·
维护者通常 1 天内回复
-
area:runtime bug
难度 4/5 3-5 天 新手友好度 52/100
fglock/PerlOnJava#2022 ·
维护者通常 1 天内回复
-
area:backend area:cpan-port area:parser area:runtime bug
难度 4/5 3-5 天 新手友好度 54/100
fglock/PerlOnJava#2021 ·
维护者通常 1 天内回复
查看 fglock/PerlOnJava 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 94/100
VEuPathDB/ApiCommonModel#260 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
ibmdb/perl_DBD-DB2#21 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
-
`config --theme` can't find theme files when the `~/Documents/Themes` directory is a symbolic link未关闭
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
1.severity: security
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复