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
return() resets named arguments #1764
Comments
From @moritz15:18 <@moritz_> rakudo: sub foo() { return 1,2,:c<3> }; say foo().perl |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in at least one of these files: misc/helpnow/README, t/spec/S06-advanced_subroutine_features/return.t commit d98dc61c3112db38ac492c0df797d66e735d43da [t/spec] tests for RT #75118, named arguments to return() Inline Patchdiff --git a/misc/helpnow/README b/misc/helpnow/README
index f2714ea..882e333 100644
--- a/misc/helpnow/README
+++ b/misc/helpnow/README
@@ -21,6 +21,8 @@ Perl 6 that's achievable for a newcomer.
Port a smallish module
- Log::Message
+ - Text::Wrap
+ - Text::Soundex (but wait until Str.trans is implemented)
Implement $smallish_feature in $implementation
diff --git a/t/spec/S06-advanced_subroutine_features/return.t b/t/spec/S06-advanced_subroutine_features/return.t
index 4fe6797..ead6cb8 100644
--- a/t/spec/S06-advanced_subroutine_features/return.t
+++ b/t/spec/S06-advanced_subroutine_features/return.t
@@ -15,7 +15,7 @@ See also t/blocks/return.t, which overlaps in scope.
# reference for the spec for 'return', but I couldn't find
# one either.
-plan 73;
+plan 76;
# These test the returning of values from a subroutine.
# We test each data-type with 4 different styles of return.
@@ -300,6 +300,17 @@ is Foo.new.officialsubmeth(), 43,
is Foo::official(), 44,
"return correctly from official sub only";
+# RT #75118
+{
+ sub named() {
+ return 1, 2, :c(3);
+ }
+ is named().elems, 3, 'return with named arguments';
+ is named().[2].key, 'c', ' ... correct key';
+ #?rakudo todo 'named argument to return()'
+ is named().[2].value, '3', ' ... correct value';
+}
+
# RT #61732
{
sub rt61732_c { 1; CATCH {} } |
The RT System itself - Status changed from 'new' to 'open' |
From @cokeOn Sat May 15 06:21:47 2010, moritz wrote:
Still wrong, but updated: $ ./perl6 -e 'sub foo() { return 1,2,:c<3> }; say foo().perl' -- |
From @ninerThis was fixed by Rakudo commit 0d40e00 perl6 -e 'sub foo() { return 1,2,:c<3> }; say foo().perl' |
@niner - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#75118 (status was 'resolved')
Searchable as RT75118$
The text was updated successfully, but these errors were encountered: