Imported Language::Functional break subroutine is parsed as an operator
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Start with the upstream reproduction in t/simple.t at line 77 and the focused project regression that reproduces it on both backends. Trace how imported subroutines are resolved when their names overlap with operators, then run the JVM and interpreter tests. Done means break { ... } $list parses and executes on both backends, genuine operators still work, and the upstream 97-test suite passes.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Perl
- Stars
- 64
- Forks
- 6
- Avg merge
- 5h 38m
- Merged PRs (30d)
- 170
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fglock/PerlOnJava
-
area:cpan-port area:unicode bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
fglock/PerlOnJava#1341 ·
-
area:backend area:runtime bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fglock/PerlOnJava#1511 ·
-
area:backend area:cpan-port bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fglock/PerlOnJava#1508 · 1 comment ·
-
area:cpan-port area:platform enhancement
Difficulty 5/5 Over a week Newbie friendliness 30/100
fglock/PerlOnJava#1507 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fglock/PerlOnJava#1506 ·
All issues in fglock/PerlOnJava
Similar issues
-
documentation Needs Triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
trizen/youtube-viewer#456 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
connectivity Open
Difficulty 1/5 Under an hour Newbie friendliness 80/100
-
Common US ingredient names are not recognized, so about 12.4k US products miss an allergen warning Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
openfoodfacts/openfoodfacts-server#14657 · 4 comments ·