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
Make 'Inf' and 'NaN' acceptable constants parameters in Rakudo #1495
Comments
From @masak<masak> rakudo: sub foo(5) { say "HAI 5!" }; foo(5) |
From @bbkrworks on Kiev build |
The RT System itself - Status changed from 'new' to 'open' |
@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-multi/type-based.t commit 0235444cbd338b0823a093899816fb4105fedb4e [t/spec/S06-multi/type-based.t] tests for RT #72750 Make Inf and NaN acceptable constants parameters in Rakudo Inline Patchdiff --git a/t/spec/S06-multi/type-based.t b/t/spec/S06-multi/type-based.t
index 37cb2db..a218b14 100644
--- a/t/spec/S06-multi/type-based.t
+++ b/t/spec/S06-multi/type-based.t
@@ -7,6 +7,7 @@ plan *;
#L<S06/"Longname parameters">
#L<S12/"Multisubs and Multimethods">
+multi foo (5) { "Constant" }
multi foo (Int $bar) { "Int " ~ $bar }
multi foo (Str $bar) { "Str " ~ $bar }
multi foo (Rat $bar) { "Rat " ~ $bar }
@@ -16,9 +17,13 @@ multi foo (Sub $bar) { "Sub " ~ $bar() }
multi foo (@bar) { "Positional " ~ join(', ', @bar) }
multi foo (%bar) { "Associative " ~ join(', ', %bar.keys.sort) }
multi foo (IO $fh) { "IO" }
+multi foo (Inf) { "Inf" }
+multi foo (NaN) { "NaN" }
+
+is foo(5), 'Constant', 'dispatched to the constant sub';
-is(foo('test'), 'Str test', 'dispatched to the Str sub');
is(foo(2), 'Int 2', 'dispatched to the Int sub');
+is(foo('test'), 'Str test', 'dispatched to the Str sub');
my $num = '4';
is(foo(1.4), 'Rat 1.4', 'dispatched to the Num sub');
@@ -34,6 +39,9 @@ is(foo(%hash), 'Associative bar, baz, foo', 'dispatched to the Associative sub')
is(foo($*ERR), 'IO', 'dispatched to the IO sub');
+is foo(Inf), 'Inf', 'dispatched to the Inf sub';
+is foo(NaN), 'NaN', 'dispatched to the NaN sub';
+
# You're allowed to omit the "sub" when declaring a multi sub.
# L<S06/"Routine modifiers">
|
Migrated from rt.perl.org#72750 (status was 'resolved')
Searchable as RT72750$
The text was updated successfully, but these errors were encountered: