fix: lexical warning bits (AnyEvent/cpan noise), AutoSplit mkdir, constant redefine#700
Merged
fix: lexical warning bits (AnyEvent/cpan noise), AutoSplit mkdir, constant redefine#700
Conversation
Subroutine redefinition and "masks earlier declaration" checks used WarningFlags.warningManager.isWarningEnabled(), which falls through to globalWarningsEnabled and treats almost every category as on once bare use warnings ran anywhere — unlike Perl, which keys off $^W and the lexical warning-bit string (including XOR/set via generated AnyEvent::common_sense). - Add WarningFlags.ckWarnForScope(scope, category) - Use it for "Subroutine ... redefined" and shadow/masking diagnostics - Gate OperatorParser duplicate-my diagnostic on shadow like EmitVariable Generated with [Cursor](https://cursor.com) Co-Authored-By: Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
- Emit Makefile mkdir for blib/lib/auto before pm_to_blib autosplit so AutoSplit does not create the directory and warn (matches typical EU::MM). - Apply ckWarnForScope(redefine) to constant subroutine redefinitions, same as non-constant subs. Generated with [Cursor](https://cursor.com) Co-Authored-By: Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Document warnings parity, AutoSplit mkdir, constant redefine scope and clarify signal test failure (forward \&_signal_exec GV stub on jperl). Generated with [Cursor](https://cursor.com) Co-Authored-By: Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
da4a415 to
b30e37d
Compare
PR #700 gated constant "Constant subroutine … redefined" with ckWarnForScope, which respects $^W; perl still emits that warning under local $^W=0 (see perl5_t/t/comp/redef.t ok 19). - Emit constant redefine unless lexical no warnings redefine (not ckWarn alone). - Treat prior subs as constant when old prototype is "()", not only "". Generated with [Cursor](https://cursor.com) Co-Authored-By: Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aligns compile-time warning checks with Perl
ckWARN/${^WARNING_BITS}(matches generated code such asAnyEvent::common_senseinconstants.pl), fixesblib/lib/autocreation before AutoSplit so EU::MM matches stock behaviour, and gates constant subroutine redefined messages like Perl.Changes
WarningFlags.ckWarnForScope— use$^W+ lexical warning bits instead ofwarningManager.isWarningEnabled()(which wrongly treatsglobalWarningsEnabledlike “almost everything on”).SubroutineParser— redefine warnings (including constant subs) useckWarnForScope(..., "redefine").EmitVariable/OperatorParser— shadow / duplicatemydiagnostics useshadow+ckWarnForScope.ExtUtils/MakeMaker.pm—mkdir -p blib/lib/autobeforepm_to_blibso AutoSplit does not create the dir and warn.Verification
makepasses.Documentation
Design note updated:
dev/modules/anyevent_fixes.md— adds a Discussion — jcpan noise & signals (2026-05-09, PR #700) section (warnings/MakeMaker scope,t/02_signals.tanalysis: forward\&_signal_execGV stub onjperl, workarounds), and refreshes §H accordingly.Related
./jcpan -t AnyEventstill failst/02_signals.t(“No signal caught”) untilGV/stub coderef parity for subs assigned after\&nameis fixed; seedev/modules/anyevent_fixes.md.