Lexical sub calls from named subs lose their binding (Test2::Tools::DOM 0.100)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by reproducing the failure with ./jperl -Ilib -I/private/tmp/cpan-module-classification/Mojo-DOM58-3.003/lib t/html.t, using lib/Test2/Tools/DOM.pm (lexical my sub call and my sub multi at lines 29 and 44, called from named subs) purely as the trigger. The real work is in the compiler's handling of lexical subs referenced from named subs — trace where named subs are compiled and how their pad/closure captures are built, since that is where the binding is dropped. Done means standard-Perl behaviour: no will not stay shared warnings and the t/html.t and t/synopsis.t tests passing.
由索引模型根据 Issue 内容生成。
描述
Module
- Distribution:
Test2-Tools-DOM0.100 - CPAN tester report: syntax error, 2026-10-25
- System Perl:
/usr/bin/perl5.34.1 on macOS arm64;prove -lr t/passes 3 files / 12 tests (with cachedMojo::DOM583.003 added only toPERL5LIB). - PerlOnJava:
timeout 120 ./jperl -Ilib -I/private/tmp/cpan-module-classification/Mojo-DOM58-3.003/lib t/html.tfails (10 test failures);t/synopsis.taborts on first call.
Reproducer and cause
lib/Test2/Tools/DOM.pm declares lexical subs my sub call and my sub multi at lines 29 and 44, then calls them from named package subs (all_text, tag, attr, etc.). PerlOnJava emits Subroutine "&call" will not stay shared / &multi warnings for these references; at runtime the lexical CV is absent and calls fail with Undefined subroutine &Test2::Tools::DOM::call called (or multi) at lines 65/69.
This isolates the failure to lexical-sub binding/capture across named subroutine bodies: the compiler is treating references to lexically declared subs as closure-pad captures that are not preserved in the named subs. Standard Perl resolves these lexical sub calls correctly. The failure happens before DOM assertion behavior is exercised.
Expected
Lexical sub references from named subs retain the lexical subroutine binding and execute as on standard Perl, without undefined-subroutine errors.
- 主要语言
- Perl
- 星标
- 67
- 派生
- 8
- 平均合并
- 5 小时 12 分钟
- 30 天内合并 PR
- 131
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fglock/PerlOnJava 的其他 Issue
-
area:cpan-port bug
难度 2/5 1-3 小时 新手友好度 70/100
fglock/PerlOnJava#2153 ·
维护者通常 1 天内回复
-
area:cpan-port area:parser bug
难度 2/5 1-3 小时 新手友好度 68/100
fglock/PerlOnJava#2137 ·
维护者通常 1 天内回复
-
area:backend area:cpan-port area:runtime bug
难度 2/5 1-3 小时 新手友好度 76/100
fglock/PerlOnJava#2071 ·
维护者通常 1 天内回复
-
area:runtime documentation enhancement
难度 2/5 1-3 小时 新手友好度 72/100
fglock/PerlOnJava#1579 ·
维护者通常 1 天内回复
-
area:cpan-port bug
难度 3/5 1-2 天 新手友好度 62/100
fglock/PerlOnJava#2157 ·
维护者通常 1 天内回复
查看 fglock/PerlOnJava 的全部 Issue
相似的 Issue
-
Dev-output directory preparation accepts file-valued lib/include paths and fails on dangling links未关闭team-cli
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
-
难度 1/5 1 小时以内 新手友好度 93/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
inverse-inc/packetfence#9728 ·
维护者通常 1 天内回复
-
fix(char-create): show the real reason a character is refused可能已有人在做 @baphomello 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复