Skip to content

Commit

Permalink
Merge pull request #789 from zoffixznet/fix-RT128019-warning-on-S-rep…
Browse files Browse the repository at this point in the history
…lacement

Fix RT#128019: LTA warning on smartmatch against S///
  • Loading branch information
lizmat committed Jun 18, 2016
2 parents a6e0cc2 + be210fb commit 449a2e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Perl6/Actions.nqp
Expand Up @@ -6313,7 +6313,7 @@ class Perl6::Actions is HLL::Actions does STDActions {

sub check_smartmatch($/,$pat) {
if nqp::can($pat,'ann') && $pat.ann('is_S') {
$/.PRECURSOR.worry('Smartmatch with S/// can never succeed because the string it returns will fail to match. You can use given instead of ~~.');
$/.PRECURSOR.worry('Smartmatch with S/// is not useful. You can use given instead: S/// given $foo');
}

if $pat ~~ QAST::WVal && istype($pat.returns, $*W.find_symbol(['Bool'])) && nqp::isconcrete($pat.value) {
Expand Down

0 comments on commit 449a2e7

Please sign in to comment.