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

Short-circuit expressions leak list context through scalar prototypes

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

维护者通常 1 天内回复

@fglock 已经在做这个了。

开始于 2026年10月27日。

  • #1893 来自 @fglock —— 未关闭

评估

难度
4/5
预计耗时
1-2 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
java, perl
领域
compilers, testing

调研方向

Start with the prototype parsing path that reparses parenthesized low-precedence expressions, then run the focused regression prototype_parenthesized_and_argument.t on both JVM and interpreter backends. Compare the argument count and values with system Perl’s scalar-prototype behavior; done means the regression and the two upstream t/use.t assertions pass on both backends.

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

描述

area:parser bug

Summary

Short-circuit expressions passed to scalar-prototype arguments can retain list context in PerlOnJava. This causes the upstream GMail-Checker-1.04 test t/use.t to fail both assertions under Test::ok ($;$$).

Reproducer

use strict;
use warnings;
use Test;
BEGIN { plan tests => 1 }
our @args;
sub capture ($;$$) { @args = @_ }
my $object = bless {}, 'Example';
capture (defined($object) and (ref $object, 'new() is ok'));
print scalar(@args), "|", join('|', @args), "\n";

System Perl treats the parenthesized short-circuit expression as one scalar-prototype argument. PerlOnJava previously passed two values, so the and expression's list-valued right side escaped into the call argument list.

Evidence

  • CPAN distribution: GMail-Checker 1.04, CPAN run 20261026-163826-15395.
  • System Perl 5.42.2 on macOS: upstream t/use.t passes (2/2).
  • PerlOnJava 5.44.1 on the JVM and interpreter backends: upstream t/use.t failed (0/2) before the fix.
  • The focused regression prototype_parenthesized_and_argument.t failed on the JVM before the fix and passes on both backends after it.
  • The distribution is pure Perl and needs no Gmail credentials for these two tests.

The fix preserves scalar context when prototype parsing reparses a parenthesized low-precedence expression.

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

环境准备

  • 提供 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 摘要。