Skip to content

Commit 439f6e0

Browse files
committed
test for RT #76834
1 parent b518730 commit 439f6e0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

S12-subset/subtypes.t

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,12 @@ ok "x" !~~ NW1, 'subset declaration without where clause rejects wrong value';
231231
subset Many::Parts of Str;
232232
ok 'a' ~~ Many::Parts, 'subset names with many parts work';
233233
}
234+
235+
{
236+
subset Int::Positive of Int where { $_ > 0 };
237+
sub f(Int::Positive $a) { $a * $a };
238+
nok eval('f(-2)'), 'Cannot violate Int::Positive constraint';
239+
}
234240
done;
235241

236242
# vim: ft=perl6

0 commit comments

Comments
 (0)