# New Ticket Created by Zoffix Znet # Please include the string: [perl #128019] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=128019 >
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'