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
Trying to smartmatch against S/// gives a compile time warning:
'Smartmatch with S/// can never succeed because the string it returns will fail to match' [...]
First, that warning is inaccurate, because if S/// doesn't match the string, it'll return the original string, which will smartmatch as True.
Also, the second part of the error is misleading:
[...] 'You can use given instead of ~~.'
It's perfectly understandable if a new Perl 6 programmer will take that to mean "change ~~ to `given`". And if they do so, they'll get another confusing (to a beginner) error, since there's no .match method in their code:
Method 'match' not found for invocant of class 'Any'
Thus, I propose the error message to be changed to the following:
'Smartmatch with S/// is not useful. You can use given instead: S/// given $foo'
Migrated from rt.perl.org#128019 (status was 'resolved')
Searchable as RT128019$
The text was updated successfully, but these errors were encountered: