New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@_ doesn't get the first argument #798
Comments
From @moritz00:01 < moritz_> rakudo: my $c = { say $_; say @_.perl }; $c(2, 3, 4, 5) It's probably right that $_ gets 2, but @_[0] should also be 2. Cheers, |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S06-signature/sub-ref.t commit 5083fd82fecfbb1a527f1891758cc3c507c1816b [t/spec] Test for RT #63974 Inline Patchdiff --git a/t/spec/S06-signature/sub-ref.t b/t/spec/S06-signature/sub-ref.t
index 570048d..60b81c0 100644
--- a/t/spec/S06-signature/sub-ref.t
+++ b/t/spec/S06-signature/sub-ref.t
@@ -4,7 +4,7 @@ use Test;
# L<S02/"Built-In Data Types">
-plan 33;
+plan 35;
=begin description
@@ -50,6 +50,19 @@ See L<S02/"Built-in Data Types"> for more information about Code, Routine, Sub,
dies_ok { $foo.() }, "invocation of an parameterized block expecting a param without a param dies";
}
+# RT #63974
+{
+ my $topic = 'topic unchanged';
+ my @topic_array = <topic array unchanged>;
+ my $c = { $topic = $_; @topic_array = @_ };
+
+ $c( 2, 3, 4, 5 );
+
+ is $topic, 2, '$_ got right value for code ref';
+ #?rakudo todo 'RT #63974'
+ is @topic_array, ( 2, 3, 4, 5 ), '@_ got right value in code ref';
+}
+
{
my $foo = sub { 100 + (@_[0] // -1) };
isa_ok($foo, Code); |
The RT System itself - Status changed from 'new' to 'open' |
From @moritzTests pass, jnthn++. |
@moritz - Status changed from 'open' to 'resolved' |
@moritz - Status changed from 'resolved' to 'open' |
From @moritzAfter the 'ng' merge the tests are failing again (though they have been |
From @bbkrThey pass again on Kiev build. perl t/harness --fudge --keep-exit-code --icu=0 --jobs |
@bbkr - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#63974 (status was 'resolved')
Searchable as RT63974$
The text was updated successfully, but these errors were encountered: