Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Short-circuit expressions leak list context through scalar prototypes

Geschlossen
#1,891 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@fglock arbeitet bereits daran.

Seit 27.10.2026.

  • #1893 von @fglock — offen

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
55/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
java, perl
Bereich
compilers, testing

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Perl
Sterne
65
Forks
8
Ø Merge
6 Std. 28 Min.
Gemergte PRs (30 T.)
184

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus fglock/PerlOnJava

Alle Issues in fglock/PerlOnJava

Ähnliche Issues

Weitere Issues zu Perl

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.