Imported Language::Functional break subroutine is parsed as an operator
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
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
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.tpasses 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
breakcan be called in the upstream formbreak { ... } $liston both JVM and interpreter backends. Language::Functional0.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.tline 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::timefailing to override the built-intimeoperator. 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
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fglock/PerlOnJava
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
fglock/PerlOnJava#1579 ·
I maintainer di solito rispondono entro 1 giorno
-
area:cpan-port area:unicode bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
fglock/PerlOnJava#1341 ·
I maintainer di solito rispondono entro 1 giorno
-
area:platform area:runtime bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
fglock/PerlOnJava#1635 ·
I maintainer di solito rispondono entro 1 giorno
-
area:cpan-port area:runtime bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
fglock/PerlOnJava#1634 ·
I maintainer di solito rispondono entro 1 giorno
-
area:cpan-port bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
fglock/PerlOnJava#1633 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di fglock/PerlOnJava
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
convos-chat/convos#977 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
inverse-inc/packetfence#9387 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
linux-test-project/lcov#552 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
szTheory/exifcleaner#383 ·
I maintainer di solito rispondono entro 1 giorno
-
1.severity: security
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
NixOS/nixpkgs#569828 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno