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 de0ce3a commit 071720bCopy full SHA for 071720b
S04-declarations/smiley.t
@@ -1,7 +1,7 @@
1
use v6;
2
use Test;
3
4
-plan 57;
+plan 60;
5
6
my Int:D $j = 256;
7
MY::<$j> = 111;
@@ -142,4 +142,17 @@ throws-like 'use variables :foo',
142
name => 'foo',
143
'does use variables :foo fail';
144
145
+# RT #126291
146
+{
147
+ my Int:D $x is default(0);
148
+ is $x, 0, 'Int:D with default value via trait';
149
+
150
+ my Int:D @array is default(0); @array[0] = Nil;
151
+ is @array[0], 0, 'Int:D array with default value via trait';
152
153
+ throws-like { @array[0] = Int },
154
+ X::TypeCheck::Assignment,
155
+ symbol => '@array', 'type check happens for Int:D array';
156
+}
157
158
# vim: ft=perl6
0 commit comments