-
-
Save zoffixznet/d74b81e7e95bb93df8c3584b136d3c78 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cpan@perlbuild2~/CPANPRC/rakudo (nom)$ gd | |
diff --git a/src/core/traits.pm b/src/core/traits.pm | |
index ff15d09..f7e870d 100644 | |
--- a/src/core/traits.pm | |
+++ b/src/core/traits.pm | |
@@ -144,6 +144,16 @@ multi sub trait_mod:<is>(Routine:D $r, :$onlystar!) { | |
$r.set_onlystar(); | |
} | |
multi sub trait_mod:<is>(Routine:D $r, :prec(%spec)!) { | |
+ nqp::if( | |
+ nqp::if( | |
+ nqp::istrue(%spec<assoc>), | |
+ nqp::if( | |
+ nqp::iseq_s(%spec<assoc>, 'list'), | |
+ nqp::isne_s(nqp::substr($r.name, 0, 6), 'infix'), | |
+ ) | |
+ ), | |
+ note "\n\n\n\nCannot set `list` assoc on non-infix routine {$r.name}\n\n\n\n" | |
+ ); | |
my role Precedence { | |
has %!prec; | |
proto method prec(|) { * } | |
cpan@perlbuild2~/CPANPRC/rakudo (nom)$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment