Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Short-circuit expressions leak list context through scalar prototypes

クローズ
#1,891 コメント 0 件 リアクション 0 件 担当者 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分
マージ済み PR(30日)
185

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fglock/PerlOnJava のほかの issue

fglock/PerlOnJava の issue をすべて見る

似ている issue

Perl の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。