Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Support indirect-object method dispatch used by Set::IntSpan

未关闭
#1,429 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
perl

调研方向

首先在 JVM 和解释器两个后端上运行 t/real_set.t 中针对 Set::IntSpan 的专门测试,尤其关注第 22 行附近的间接调用。跟踪 parser/compiler 对这些调用的处理,并将其与 issues #1166 和 #1314 中相关的 parser 工作进行比较。当四种形式都能正确 dispatch、添加回归覆盖,并且完整的 1,947 项测试套件全部通过时,即视为完成。

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

描述

area:cpan-port area:parser bug

Summary

Set::IntSpan 1.19 fails one upstream test under PerlOnJava because valid Perl indirect-object method syntax is resolved as a call to a nonexistent main:: subroutine.

Reproduction

Run the normal Set::IntSpan 1.19 test suite. The focused failure is t/real_set.t, which contains calls such as:

my $set_2 = union $set "1-5,8-9";
my $set_3 = union $set $set_2;
my $set_4 = union $set +[1, 5, 2, 8, 9, 1, 3, 4, 9];

These are valid Perl indirect-object method calls. The union method is implemented by Set::IntSpan and is used through the object in $set.

Expected result

System Perl passes the complete upstream suite:

  • 20 test files
  • 1,947 tests
  • t/real_set.t passes all 4 tests

Actual result

PerlOnJava runs the first real_set.t operation successfully, then fails at the next indirect method call:

1..4
#real_set
#real_set:  union set -> -
ok 1
Undefined subroutine &main::union called at t/real_set.t line 22.

The archived CPAN run records:

Failed 1/20 test programs. 0/1944 subtests failed.

The focused t/real_set.t failure reproduces on both the JVM and interpreter backends.

Likely root cause

The parser/compiler recognizes the first form, union $set, sufficiently to execute the empty-set case, but does not consistently preserve the indirect-object method dispatch when additional arguments follow. It emits or resolves union as an ordinary bareword subroutine call in the main package instead of dispatching it as a method on $set.

This is a pure-Perl parser/runtime compatibility issue. Set::IntSpan contains no XS, C, XSLoader, DynaLoader, or FFI dependency, and the failure is independent of services or platform prerequisites.

Acceptance criteria

  • All indirect-object method forms used by Set::IntSpan t/real_set.t dispatch to the object method on both backends.
  • Set::IntSpan 1.19 passes all 1,947 upstream tests on JVM and interpreter backends.
  • Add project-owned regression coverage for an indirect method call with no extra argument, a string argument, an object argument, and an array-reference argument.
  • Preserve existing parsing behavior for ordinary bareword subroutine calls and malformed syntax.

Evidence

  • CPAN run: 20260918-141920-96054
  • Distribution: Set-IntSpan-1.19
  • Failing test: t/real_set.t, line 22 (union $set "1-5,8-9")
  • System Perl: PASS, 20 files / 1,947 tests
  • PerlOnJava: FAIL, 1 file; the run reached 1,944 tests before aborting
  • JVM and interpreter: focused failure reproduced

Related issues

  • #1166 tracks valid fully-qualified indirect-object constructor forms. It covers a related parser area, but not this unqualified indirect-object method dispatch form.
  • #1314 tracks bareword filehandle method dispatch used by Expect. It is related at the method-dispatch level, but this failure involves a normal Perl object and does not depend on filehandle or IO behavior.

This issue should be coordinated with those parser/runtime fixes, while retaining Set::IntSpan as independent regression coverage.

主要语言
Perl
星标
64
派生
6
平均合并
5 小时 38 分钟
30 天内合并 PR
170

贡献指南

打开贡献指南

从这里开始

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

fglock/PerlOnJava 的其他 Issue

查看 fglock/PerlOnJava 的全部 Issue

相似的 Issue

更多 Perl Issue

把新 issue 发到你的邮箱

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