Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Imported Language::Functional break subroutine is parsed as an operator

Chiusa
#1,430 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java, perl
Ambito
backend, compilers

Direzione di ricerca

Inizia con la riproduzione upstream in t/simple.t alla riga 77 e con la regressione mirata del progetto che la riproduce su entrambi i backend. Traccia come vengono risolte le subroutine importate quando i loro nomi coincidono con operatori, quindi esegui i test JVM e dell'interprete. Il lavoro è completato quando break { ... } $list viene analizzato ed eseguito su entrambi i backend, gli operatori genuini continuano a funzionare e la suite di test upstream da 97 test passa.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:cpan-port area:parser bug

Summary

Language::Functional 0.05 fails under PerlOnJava because its exported break function is parsed as a built-in operator instead of being resolved as the imported Perl subroutine.

Reproduction

The upstream test t/simple.t imports all functions from Language::Functional and calls:

use Language::Functional ':all';

ok(eval {show(break { shift() >= 4 } [1..6])},
   '[[1, 2, 3], [4, 5, 6]]');

Language::Functional defines and exports break as a normal Perl subroutine with prototype (&$).

Expected result

System Perl passes the complete upstream suite:

  • 2 test files
  • 97 tests
  • t/simple.t passes all 96 tests

Actual result

The archived CPAN run fails during compilation at t/simple.t line 77, before the planned assertions execute:

JVM backend:

Operator "break" doesn't have a defined JVM descriptor at t/simple.t line 77, near ""

Interpreter backend:

Unsupported operator: break at t/simple.t line 77, near ""

The focused test reproduces this failure on both backends. The failure is recorded under target label InfiniteList, but the failing distribution is Language::Functional 0.05.

Likely root cause

PerlOnJava reserves or dispatches break as an operator before considering the imported subroutine installed by use Language::Functional ':all'. Standard Perl resolves this source form to the imported function, including its (&$) prototype and block argument.

This is a parser/symbol-resolution compatibility defect involving imported subroutines whose names overlap with built-in or feature-related operators. It is pure Perl and does not involve XS code, native libraries, or external services.

Acceptance criteria

  • An imported subroutine named break can be called in the upstream form break { ... } $list on both JVM and interpreter backends.
  • Language::Functional 0.05 passes all 97 upstream tests without modifying its tests.
  • Add focused project-owned regression coverage for an imported subroutine shadowing or overriding a built-in/feature-related operator name.
  • Preserve genuine operator behavior when no overriding subroutine is imported.
  • Preserve prototype-aware parsing of the block argument.

Evidence

  • CPAN run: 20260918-141920-96054
  • Distribution: Language-Functional-0.05
  • Failing test: t/simple.t line 77, break { shift() >= 4 } [1..6]
  • System Perl: PASS, 2 files / 97 tests
  • PerlOnJava: FAIL before assertions in t/simple.t
  • JVM and interpreter: focused failure reproduced

Related issues

  • #19 tracks imported Time::HiRes::time failing to override the built-in time operator. It is closed and concerns a different operator, but the import-vs-core-operator resolution problem is related.
  • #1257 tracks symbol-resolution collisions between imported constants and lexical declarations. It is open and related to preserving Perl namespaces and imported symbol identity, but it does not cover operator-shaped subroutine calls.

This issue should be coordinated with those efforts while retaining Language::Functional as independent regression coverage.

Lingua principale
Perl
Stelle
64
Fork
7
Merge medio
4h 29m
PR unite (30g)
176

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fglock/PerlOnJava

Tutte le issue di fglock/PerlOnJava

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.