Skip to content

Commit a2c5381

Browse files
committed
Test for X::Syntax::Signature::InvocantNotAllowed.
1 parent 0a2bf66 commit a2c5381

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

S06-signature/errors.t

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use v6;
22

33
use Test;
44

5-
plan 27;
5+
plan 31;
66

77
=begin pod
88
@@ -83,4 +83,10 @@ throws-like 'my class A { submethod BUILD(:$!notthere = 10) { } }; A.new',
8383
ok $error ~~ /^^ \h* '(Int'/, "Error mentions Int";
8484
ok $error ~~ / :i call /, '... error message mentions "call"';
8585
}
86+
87+
throws-like 'sub foo($a:) { }', X::Syntax::Signature::InvocantNotAllowed;
88+
throws-like 'sub foo($a: $b) { }', X::Syntax::Signature::InvocantNotAllowed;
89+
throws-like '-> $a: { }', X::Syntax::Signature::InvocantNotAllowed;
90+
throws-like '-> $a: $b { }', X::Syntax::Signature::InvocantNotAllowed;
91+
8692
# vim: ft=perl6

0 commit comments

Comments
 (0)