From 08ed79bfbb968a8f35153dca173d39670a0e7fd3 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Mon, 11 Dec 2017 14:38:31 -0500 Subject: [PATCH] Test throwage on conflicting type constraints in `my` RT#126123: https://rt.perl.org/Ticket/Display.html?id=126123 --- S04-declarations/my.t | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/S04-declarations/my.t b/S04-declarations/my.t index 7cc1960613..6bca876aff 100644 --- a/S04-declarations/my.t +++ b/S04-declarations/my.t @@ -1,7 +1,7 @@ use v6; use Test; -plan 106; +plan 107; #L @@ -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