You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*Result:*
Potential difficulties:
Smartmatch against True always matches; if you mean to test the topic
for truthiness, use :so or *.so or ?* instead
at -e:1
------> 42 ~~ ⏏True
So it is not a bug by itself, it's just how smartmatching works. But we
should definitely print a warning there (or maybe even a compile-time
error?).
On Sat, 26 Nov 2016 13:19:50 -0800, alex.jakimenko@gmail.com wrote:
*Code:*
sub foo(True) { say ‘ok’ };
foo(False)
*Result:*
ok
The reason for it is the following:
*Code:*
42 ~~ True
*Result:*
Potential difficulties:
Smartmatch against True always matches; if you mean to test the topic
for truthiness, use :so or *.so or ?* instead
at -e:1
------> 42 ~~ ⏏True
So it is not a bug by itself, it's just how smartmatching works. But we
should definitely print a warning there (or maybe even a compile-time
error?).
Migrated from rt.perl.org#130182 (status was 'resolved')
Searchable as RT130182$
The text was updated successfully, but these errors were encountered: