Parser rejects valid `return sort map` in Mojolicious 9.49
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
調査の方向性
The issue is in the parser's diagnostic logic for the return statement, likely in the file handling the commit d4ebdd9b4. Start by examining the parser's grammar for return and the diagnostic for indirect map/grep arguments. The failing code is in Mojo/Loader.pm line 37. Write a test that reproduces the error with return sort map ... and ensure the diagnostic only triggers for return map/grep ... without an intervening list operator like sort.
索引モデルが issue の本文から書いたものです。
説明
Summary
PerlOnJava cannot load Mojolicious 9.49 because the parser rejects valid Perl in Mojo::Loader::find_packages:
return sort map { /^(.+)::$/ ? "${ns}::$1" : () } keys %{"${ns}::"};
The error is:
Missing comma after first argument to return
This causes WebService-Rollbar-Notifier 1.002011 to fail its load tests.
Reproduction
Archived CPAN run: 20260924-085657-82687
Target distribution: WebService-Rollbar-Notifier-1.002011
The target fails 2 of 3 tests in t/00-load.t while loading Mojo::UserAgent and WebService::Rollbar::Notifier. The failure reproduces on both the JVM and interpreter backends.
A minimal load reproducer is:
PERL5LIB=<Mojolicious-lib> ./jperl -MMojo::Loader -e 'print "loaded\\n"'
PERL5LIB=<Mojolicious-lib> ./jperl --interpreter -MMojo::Loader -e 'print "loaded\\n"'
Both report the diagnostic at Mojo/Loader.pm line 37. System Perl loads the same module successfully.
Expected behavior
Mojo::Loader should compile successfully. System Perl passes Mojolicious 9.49's complete suite (4,194 tests) and the Rollbar distribution's 5 tests.
Suspected cause
The regression appears related to the indirect return map/grep diagnostic added in commit d4ebdd9b4 (fix: diagnose indirect map arguments to return). The diagnostic logic appears to treat return sort map ... as an invalid indirect map argument, although the intervening sort makes this valid Perl.
Requested fix
Restrict the diagnostic to actual indirect return NAME map/grep ... forms while preserving valid list operators such as return sort map .... Add a focused regression test for the Mojolicious expression and retain the existing diagnostic coverage.
- 主要言語
- Perl
- スター
- 64
- フォーク
- 6
- 平均マージ
- 5時間 38分
- マージ済み PR(30日)
- 170
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fglock/PerlOnJava のほかの issue
-
area:cpan-port area:unicode bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
fglock/PerlOnJava#1341 ·
-
area:backend area:runtime bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
fglock/PerlOnJava#1511 ·
-
area:backend area:cpan-port bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
fglock/PerlOnJava#1508 · コメント 1 件 ·
-
area:cpan-port area:platform enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
fglock/PerlOnJava#1507 ·
-
bug enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
fglock/PerlOnJava#1502 ·
fglock/PerlOnJava の issue をすべて見る
似ている issue
-
documentation Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
trizen/youtube-viewer#456 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
connectivity オープン
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
-
Common US ingredient names are not recognized, so about 12.4k US products miss an allergen warning オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
openfoodfacts/openfoodfacts-server#14657 · コメント 4 件 ·