Skip to content

Commit

Permalink
test for RT #71820, failed subset type check error includes name of s…
Browse files Browse the repository at this point in the history
…ubset
  • Loading branch information
moritz committed Oct 5, 2011
1 parent ef8462e commit 044a4a6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions S12-subset/subtypes.t
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,15 @@ ok "x" !~~ NW1, 'subset declaration without where clause rejects wrong value';
sub f(Int::Positive $a) { $a * $a };
nok eval('f(-2)'), 'Cannot violate Int::Positive constraint';
}

# RT #71820
{
subset Interesting of Int where * > 10;
class AI { has Interesting $.x };
eval 'AI.new(x => 2)';
ok $!.Str ~~ /Interesting/, 'error message mentions subset name';

}
done;

# vim: ft=perl6

0 comments on commit 044a4a6

Please sign in to comment.