Permalink
Browse files

my Num List sub should allow return of empty list RT #65128

git-svn-id: http://svn.pugscode.org/pugs@26500 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent e70591f commit cd128b1b6e90a60604062436c0eba92d95d3a09b ron committed Apr 27, 2009
Showing with 18 additions and 1 deletion.
  1. +18 −1 S06-routine-modifiers/scoped-named-subs.t
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 8;
+plan 12;
# L<S06/Named subroutines>
@@ -33,3 +33,20 @@ is ourNamedStr(), 'string', 'Correct : package-scoped named sub ourNamedStr() sh
}
is ourNamedInt(), 55, 'Correct : package-scoped named sub ourNamedInt() should BE available in the whole package';
+eval_dies_ok
+ 'my Num List sub f () { return ("A") }; f()',
+ 'Return of list with wrong type dies';
+
+#?rakudo todo 'RT 65128'
+#?DOES 3
+{
+eval_lives_ok
+ 'my Num List sub f () { return () }; f()',
+ 'return of empty list should live';
+is eval('my Num List sub f () { return () }; (f(), "a")'), ['a'],
+ 'return of empty list should be empty list';
+
+eval_dies_ok
+ 'my Num List sub f () { ("A") }; f()',
+ 'implicit return of list with wrong type dies';
+}

0 comments on commit cd128b1

Please sign in to comment.