-
Notifications
You must be signed in to change notification settings - Fork 550
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
index() optimisation in when clause fails #16626
Comments
From joshuamy@gmail.comPerl 5.28 introduced a index() optimisation when comparing to -1 (or When this optimisation is triggered in a `when` clause, it warns, eg. use v5.28; my $s ='foo'; given ($s) { This gives the warning: Argument "foo" isn't numeric in smart match. Due to Current work-around is to force numeric evaluation, ie. when ( 0 + index($s, 'f') > -1 ) { ... } This is a regression, issue does not occur under 5.26. Flags: Site configuration information for perl 5.28.0: Configured by joshua at Tue Jul 10 10:15:19 AEST 2018. Summary of my perl5 (revision 5 version 28 subversion 0) configuration: Platform: Locally applied patches: @INC for perl 5.28.0: /usr/tools/plenv/versions/5.28.0/lib/perl5/site_perl/5.28.0/x86_64-linux-multi Environment for perl 5.28.0: PATH=/usr/tools/plenv/versions/5.28.0/bin:/usr/tools/plenv/libexec:/usr/tools/plenv/plugins/perl-build/bin:/usr/tools/plenv/plugins/plenv-update/bin:/usr/tools/luaenv/shims:/usr/tools/luaenv/bin:/usr/tools/rbenv/shims:/usr/tools/rbenv/bin:/usr/tools/pyenv/shims:/usr/tools/pyenv/bin:/usr/tools/plenv/shims:/usr/tools/plenv/bin:/usr/tools/perl6/bin:/usr/tools/perl6/share/perl6/site/bin:/usr/tools/smalltalk/bin:/usr/tools/postgres/bin:/usr/tools/tmux/bin:/usr/tools/nim/bin:/usr/tools/vim/bin:/usr/tools/bin:/usr/local/bin:/bin:/usr/bin:/home/joshua/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/joshua/bin |
From @iabynOn Thu, Jul 12, 2018 at 08:24:27PM -0700, Joshua (via RT) wrote:
Now fixed in blead with the following. A good candidate for backporting to commit 6b877bb treat when(index() > -1) as a boolean expression -- |
The RT System itself - Status changed from 'new' to 'open' |
From @steve-m-hayThis was fixed in blead by commit 6b877bb, and back-ported to 5.28.1 by commit 9fcae9f. Awaiting release in 5.30.0. |
@steve-m-hay - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.30.0, this and 160 other issues have been Perl 5.30.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#133368 (status was 'resolved')
Searchable as RT133368$
The text was updated successfully, but these errors were encountered: