Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

given/when/smartmatch deprecation warnings #14

Closed
gregoa opened this issue Aug 26, 2023 · 2 comments
Closed

given/when/smartmatch deprecation warnings #14

gregoa opened this issue Aug 26, 2023 · 2 comments

Comments

@gregoa
Copy link
Contributor

gregoa commented Aug 26, 2023

In perl 5.38, the warning about given/when/smartmatch were moved from the experimental category to the new deprecated category. While the code suppress the former warnings:

bin/efa:no if $] >= 5.018, warnings => 'experimental::smartmatch';
lib/Travel/Routing/DE/EFA.pm:no if $] >= 5.018, warnings => "experimental::smartmatch";
lib/Travel/Routing/DE/VRR.pm:no if $] >= 5.018, warnings => "experimental::smartmatch";

the latter now show up, e.g. when running the test suite under 5.38:

given is deprecated at /build/libtravel-routing-de-vrr-perl-2.21/blib/lib/Travel/Routing/DE/EFA.pm line 179.
when is deprecated at /build/libtravel-routing-de-vrr-perl-2.21/blib/lib/Travel/Routing/DE/EFA.pm line 180.
when is deprecated at /build/libtravel-routing-de-vrr-perl-2.21/blib/lib/Travel/Routing/DE/EFA.pm line 181.
when is deprecated at /build/libtravel-routing-de-vrr-perl-2.21/blib/lib/Travel/Routing/DE/EFA.pm line 182.
given is deprecated at /build/libtravel-routing-de-vrr-perl-2.21/blib/lib/Travel/Routing/DE/EFA.pm line 198.
when is deprecated at /build/libtravel-routing-de-vrr-perl-2.21/blib/lib/Travel/Routing/DE/EFA.pm line 199.
when is deprecated at /build/libtravel-routing-de-vrr-perl-2.21/blib/lib/Travel/Routing/DE/EFA.pm line 200.
when is deprecated at /build/libtravel-routing-de-vrr-perl-2.21/blib/lib/Travel/Routing/DE/EFA.pm line 201.
Smartmatch is deprecated at /build/libtravel-routing-de-vrr-perl-2.21/blib/lib/Travel/Routing/DE/EFA.pm line 232.
Smartmatch is deprecated at /build/libtravel-routing-de-vrr-perl-2.21/blib/lib/Travel/Routing/DE/EFA.pm line 308.
Smartmatch is deprecated at /build/libtravel-routing-de-vrr-perl-2.21/blib/lib/Travel/Routing/DE/EFA.pm line 731.

Now one option would be to suppress the new warnings as well, e.g.

no if $] >= 5.017011, warnings => 'experimental::smartmatch';
no if $] >= 5.037010, warnings => 'deprecated::smartmatch';

but given the announcement that given/when/smartmatch is to be removed in 5.42, a rewrite of the affected code might be better in the long run.

Cheers,
gregor

@derf derf closed this as completed in d6b7c4e Sep 1, 2023
@derf
Copy link
Owner

derf commented Sep 1, 2023

Indeed. Thanks for pointing it out!

@gregoa
Copy link
Contributor Author

gregoa commented Sep 1, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants