We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80ba7dc commit 98bdc2dCopy full SHA for 98bdc2d
S06-signature/definite-return.t
@@ -2,7 +2,7 @@ use v6;
2
3
use Test;
4
5
-plan 17;
+plan 19;
6
7
# L<S06/Signatures>
8
@@ -122,6 +122,16 @@ constant indiana-pi = 3;
122
is return-fifteen(), indiana-pi, 'can return indiana-pi';
123
}
124
125
+{
126
+ my $pointy = -> --> 42 { };
127
+ is $pointy(), 42, 'pointy can have definite return type that is an integer';
128
+}
129
+
130
131
+ my $pointy = -> --> Nil { sin(1) };
132
+ ok $pointy() === Nil, 'pointy can have definite return type of Nil';
133
134
135
# returns vs -->
136
# indefinite vs immutable vs mutable
137
# what are some wacky immutable values that we could return? (*)
0 commit comments