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
Param typed with Bool doesn't accept :foo-type argument in Rakudo #1288
Comments
From @masak<masak> rakudo: sub foo(Bool :$x) {}; foo(:x) This should work, because according to S02, :x is short for x => True. |
From @bbkrOn Kiev build $ perl6 -e 'sub foo(Bool :$x) { say "works!"}; foo(:x)' Taken for testing |
The RT System itself - Status changed from 'new' to 'open' |
From @bbkrrechecked on * release, also works. |
@bbkr - Status changed from 'open' to 'resolved' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S06-signature/defaults.t commit cef0417fff18aebc1c6e25c16549e78fe0773aa4 [t/spec] tests for RT #69200 Param typed with Bool doesnt accept :foo-type argument in Rakudo Inline Patchdiff --git a/t/spec/S06-signature/defaults.t b/t/spec/S06-signature/defaults.t
index d83d80c..5bd88a5 100644
--- a/t/spec/S06-signature/defaults.t
+++ b/t/spec/S06-signature/defaults.t
@@ -10,7 +10,7 @@ Tests assigning default values to variables of type code in sub definitions.
# L<S06/Optional parameters/Default values can be calculated at run-time>
-plan 4;
+plan 5;
sub doubler($x) { return 2 * $x }
@@ -41,4 +41,10 @@ ok((MyPack::val_v), "default sub called in package namespace");
is default_with_list(), 1, 'can have a parcel literal as default value';
}
+# RT #69200
+{
+ sub rt69200(Bool :$x) { $x };
+ is rt69200(:x), True, '":x" is the same as "x => True" in sub call';
+}
+
# vim: ft=perl6 |
Migrated from rt.perl.org#69200 (status was 'resolved')
Searchable as RT69200$
The text was updated successfully, but these errors were encountered: