Skip to content

Commit

Permalink
Test throwage on conflicting type constraints in my
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Dec 11, 2017
1 parent 8cbbf89 commit 08ed79b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion S04-declarations/my.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 106;
plan 107;

#L<S04/The Relationship of Blocks and Declarations/"declarations, all
# lexically scoped declarations are visible">
Expand Down Expand Up @@ -388,4 +388,14 @@ subtest 'report Malformed my correctly' => {
throws-like q[my Any ^:D $a], X::Syntax::Malformed;
}

# RT #126123
subtest 'dies on conflicting type constraints' => {
plan 2;

throws-like my Int $a of Str, X::Syntax::Variable::ConflictingTypes,
'Type + of Type';
throws-like my Int $a of Str is default("z") of Rat, X::Comp::Group,
'Type + of Type + is default';
}

# vim: ft=perl6

0 comments on commit 08ed79b

Please sign in to comment.