Skip to content
Browse files

RT #73990, "1 but last"

  • Loading branch information...
1 parent 59ded64 commit a0df9db4b899b51e72c6288526fb10b2ace524d9 @moritz moritz committed
Showing with 16 additions and 1 deletion.
  1. +16 −1 S14-roles/mixin.t
View
17 S14-roles/mixin.t
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 30;
+plan 32;
# L<S14/Run-time Mixins/>
@@ -138,4 +138,19 @@ is (class { } but role { method answer() { 42 } }).answer, 42,
# RT #101022
lives_ok {(True but role {}).gist}, 'can mix into True';
+# RT #73990
+{
+ my $tracker = '';
+ for 1..3 {
+ $tracker ~= 'before';
+ 1 but last;
+ $tracker ~= 'after';
+ }
+ is $tracker, 'before', '"1 but last" does the same as "last"';
+
+ sub f() { role { method answer { 42 } } };
+ is (1 but f).answer, 42, '<literal> but <zero-arg call> works';
+
+}
+
# vim: syn=perl6

0 comments on commit a0df9db

Please sign in to comment.
Something went wrong with that request. Please try again.