Skip to content

Commit

Permalink
Don't warn about subsequent use VERSION if it requests the same versi…
Browse files Browse the repository at this point in the history
…on number
  • Loading branch information
leonerd committed Mar 4, 2024
1 parent bd795a9 commit 98ac939
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions op.c
Expand Up @@ -8036,6 +8036,9 @@ Perl_utilize(pTHX_ int aver, I32 floor, OP *version, OP *idop, OP *arg)
/* if the old version had no side effects, we can allow this
* without any warnings or errors */
}
else if (shortver == PL_prevailing_version) {
/* requesting the same version again is fine */
}
else if (shortver >= SHORTVER(5, 39)) {
croak("use VERSION of 5.39 or above is not permitted while another use VERSION is in scope");
}
Expand Down
2 changes: 1 addition & 1 deletion t/lib/warnings/op
Expand Up @@ -2178,5 +2178,5 @@ use VERSION while another use VERSION is in scope is deprecated, and will become
use warnings;
use v5.12;
use v5.12;
# expect no warning because same version
EXPECT
use VERSION while another use VERSION is in scope is deprecated, and will become fatal in Perl 5.46 at - line 3.

0 comments on commit 98ac939

Please sign in to comment.