Skip to content

Commit 7095892

Browse files
committed
Test Bool:D as literals in signatures warn
RT#130182: https://rt.perl.org/Ticket/Display.html?id=130182 Rakudo fix: rakudo/rakudo@b01dfcda90
1 parent 9418115 commit 7095892

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

S06-signature/types.t

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use v6;
2+
use lib <t/spec/packages>;
23
use Test;
4+
use Test::Util;
35

4-
plan 15;
6+
plan 18;
57

68
sub f($x) returns Int { return $x };
79

@@ -135,4 +137,14 @@ subtest 'numeric literals as type constraints' => {
135137
}
136138
}
137139

140+
# RT#130182
141+
{
142+
is_run -> True { }($), {:err(/'smartmatch'/), :out('')},
143+
'`True` signature literal warns';
144+
is_run -> False { }($), {:err(/'smartmatch'/), :out('')},
145+
'`False` signature literal warns';
146+
is_run -> Bool { print "ok" }(True), {:err(''), :out('ok')},
147+
'`Bool` type constraint does not warn';
148+
}
149+
138150
# vim: ft=perl6

0 commit comments

Comments
 (0)