Parser rejects valid `return sort map` in Mojolicious 9.49
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Perl
- Star
- 64
- Fork
- 6
- Merge trung bình
- 5 giờ 38 phút
- Pull request đã merge (30 ngày)
- 170
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fglock/PerlOnJava
-
area:cpan-port area:unicode bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
fglock/PerlOnJava#1341 ·
-
area:backend area:runtime bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
fglock/PerlOnJava#1511 ·
-
area:backend area:cpan-port bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
fglock/PerlOnJava#1508 · 1 bình luận ·
-
Port IPC::SysV (low priority) Đang mởarea:cpan-port area:platform enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
fglock/PerlOnJava#1507 ·
-
bug enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
fglock/PerlOnJava#1502 ·
Tất cả issue của fglock/PerlOnJava
Issue tương tự
-
documentation Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
trizen/youtube-viewer#456 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
connectivity Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
-
Common US ingredient names are not recognized, so about 12.4k US products miss an allergen warning Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
openfoodfacts/openfoodfacts-server#14657 · 4 bình luận ·