Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Expect Exception, not X::AdHoc.
The test suite we ship for 6.christmas should ideally be a subset of
the 6.d suite, and later ones. Testing against `Exception` frees us
to add further typed exceptions without breaking the promise in the
existing tests. Testing againt `X::AdHoc` does not.
  • Loading branch information
jnthn committed Nov 12, 2015
1 parent 6d71025 commit 19c27b7
Show file tree
Hide file tree
Showing 60 changed files with 164 additions and 164 deletions.
2 changes: 1 addition & 1 deletion S02-types/bag.t
Expand Up @@ -488,7 +488,7 @@ sub showkv($x) {
'Make sure we cannot assign on a key';

throws-like { $_ = 666 for $b.values },
X::AdHoc, # X::Assignment::RO ???
Exception, # X::Assignment::RO ???
'Make sure we cannot assign on a .values alias';

throws-like { .value = 999 for $b.pairs },
Expand Down
2 changes: 1 addition & 1 deletion S02-types/declare.t
Expand Up @@ -114,7 +114,7 @@ plan 70;

#?rakudo.jvm todo "RT #126526"
{
throws-like { my int $namcu; $namcu = 2**100 }, X::AdHoc,
throws-like { my int $namcu; $namcu = 2**100 }, Exception,
message => 'Cannot unbox 101 bit wide bigint into native integer',
"Assign big bigint to native won't overflow silently";
}
Expand Down
4 changes: 2 additions & 2 deletions S02-types/mix.t
Expand Up @@ -430,7 +430,7 @@ sub showkv($x) {
'Make sure we cannot assign on a key';

throws-like { $_ = 666.1 for $m.values },
X::AdHoc, # X::Assignment::RO ???
Exception, # X::Assignment::RO ???
'Make sure we cannot assign on a .values alias';

throws-like { .value = 999.1 for $m.pairs },
Expand Down Expand Up @@ -459,7 +459,7 @@ sub showkv($x) {
my %h3;
for $m.antipairs -> \p { %h3{p.value} = p.key }
is %h3.sort, (a=>1.1, b=>2.2, c=>3.3, d=>4.4), 'did we see all the antipairs';
throws-like { for $m.kxxv -> \k { say k } }, X::AdHoc, 'cannot call kxxv';
throws-like { for $m.kxxv -> \k { say k } }, Exception, 'cannot call kxxv';
}

# vim: ft=perl6
2 changes: 1 addition & 1 deletion S02-types/mixhash.t
Expand Up @@ -501,7 +501,7 @@ sub showkv($x) {
my %h3;
for $m.antipairs -> \p { %h3{p.value} = p.key }
is %h3.sort, (a=>1.1, b=>2.2, c=>3.3, d=>4.4), 'did we see all the antipairs';
throws-like { for $m.kxxv -> \k { say k } }, X::AdHoc, 'cannot call kxxv';
throws-like { for $m.kxxv -> \k { say k } }, Exception, 'cannot call kxxv';
}

# vim: ft=perl6
10 changes: 5 additions & 5 deletions S02-types/set.t
Expand Up @@ -220,11 +220,11 @@ sub showset($s) { $s.keys.sort.join(' ') }
is showset(-« set(3, 9, -4)), '-9 -3 4', '-« Set';
is showset(set(<b e g k z>)».pred), 'a d f j y', 'Set».pred';

throws-like { set(1, 2) »+« set(3, 4) }, X::AdHoc,'Set »+« Set is illegal';
throws-like { set(1, 2) »+« [3, 4] }, X::AdHoc, 'Set »+« Array is illegal';
throws-like { set(1, 2) «+» [3, 4] }, X::AdHoc, 'Set «+» Array is illegal';
throws-like { [1, 2] »+« set(3, 4) }, X::AdHoc, 'Set »+« Array is illegal';
throws-like { [1, 2] «+» set(3, 4) }, X::AdHoc, 'Set «+» Array is illegal';
throws-like { set(1, 2) »+« set(3, 4) }, Exception,'Set »+« Set is illegal';
throws-like { set(1, 2) »+« [3, 4] }, Exception, 'Set »+« Array is illegal';
throws-like { set(1, 2) «+» [3, 4] }, Exception, 'Set «+» Array is illegal';
throws-like { [1, 2] »+« set(3, 4) }, Exception, 'Set »+« Array is illegal';
throws-like { [1, 2] «+» set(3, 4) }, Exception, 'Set «+» Array is illegal';
}

#?niecza skip "Hypers not yet Set compatible"
Expand Down
4 changes: 2 additions & 2 deletions S02-types/subset.t
Expand Up @@ -22,7 +22,7 @@ throws-like 'my Even $x = 3', X::TypeCheck::Assignment,

# RT # 69518'
#?niecza todo
throws-like 'Even.new', X::AdHoc, 'Cannot instantiate a subtype';
throws-like 'Even.new', Exception, 'Cannot instantiate a subtype';

{
ok 2 ~~ Even, 'Can smartmatch against subsets 1';
Expand Down Expand Up @@ -180,7 +180,7 @@ my $a = 1;
}
my &bar := producer();
lives-ok { bar(2) }, 'where-constraint picks up the right lexical (+)';
throws-like 'bar(1)', X::AdHoc, 'where-constraint picks up the right lexical (-)';
throws-like 'bar(1)', Exception, 'where-constraint picks up the right lexical (-)';
}

{
Expand Down
2 changes: 1 addition & 1 deletion S02-types/type.t
Expand Up @@ -43,7 +43,7 @@ my Str $bar;
#?niecza skip 'native types (noauto)'
{
eval-lives-ok('my int $alpha = 1', 'Has native type int');
throws-like 'my int $alpha = Nil', X::AdHoc, 'native int type cannot be undefined';
throws-like 'my int $alpha = Nil', Exception, 'native int type cannot be undefined';
lives-ok({my Int $beta = Nil}, 'object Int type can be undefined');
eval-lives-ok('my num $alpha = 1e0', 'Has native type num');
#?rakudo.jvm todo "nigh"
Expand Down
2 changes: 1 addition & 1 deletion S03-operators/autoincrement.t
Expand Up @@ -192,7 +192,7 @@ is(%z{0}, $base, '%z{0}');
}

# RT #63644
throws-like 'my $a; $a++ ++;', X::AdHoc, 'parse error for "$a++ ++"';
throws-like 'my $a; $a++ ++;', Exception, 'parse error for "$a++ ++"';

# RT #99731
{
Expand Down
4 changes: 2 additions & 2 deletions S03-operators/misc.t
Expand Up @@ -127,9 +127,9 @@ is (2 Z 3), @z, 'joining of single items';

# comparison complains if either of its arguments is undefined - RT #93978
{
throws-like {Int < 0}, X::AdHoc;
throws-like {Int < 0}, Exception;
#?rakudo todo "RT #93978"
throws-like {"cat" gt Str}, X::AdHoc;
throws-like {"cat" gt Str}, Exception;
}


Expand Down
4 changes: 2 additions & 2 deletions S03-operators/subscript-vs-lt.t
Expand Up @@ -16,7 +16,7 @@ plan 4;

eval-lives-ok "1 <2", "infix less-than (<) requires whitespace before.";
eval-lives-ok "1 < 2" , "infix less-than (<) requires whitespace before.";
throws-like "1< 2", X::AdHoc, "infix less-than (<) requires whitespace before, so this is a parse error.";
throws-like "1<2", X::AdHoc, "infix less-than (<) requires whitespace before, so this is a parse error.";
throws-like "1< 2", Exception, "infix less-than (<) requires whitespace before, so this is a parse error.";
throws-like "1<2", Exception, "infix less-than (<) requires whitespace before, so this is a parse error.";

# vim: ft=perl6
2 changes: 1 addition & 1 deletion S03-sequence/basic.t
Expand Up @@ -242,7 +242,7 @@ is (5,4,3, { $_ - 1 || last } ... *)[^10].join(', '), '5, 4, 3, 2, 1', "sequence
}

# RT #75828
throws-like '1, 2, 3, ... 5', X::AdHoc, 'comma before sequence operator is caught';
throws-like '1, 2, 3, ... 5', Exception, 'comma before sequence operator is caught';

# RT #73268
is ~(1...^*).[^10], '1 2 3 4 5 6 7 8 9 10', 'RT #73268';
Expand Down
2 changes: 1 addition & 1 deletion S03-sequence/misc.t
Expand Up @@ -32,7 +32,7 @@ is ('a', 'b', 'c', { slip $^x ~ 'x', $^y ~ 'y' ~ $^z ~ 'z' } ... *)[^9].join(' '

# L<S03/List infix precedence/it will be taken as a yada>

throws-like '(1, 2, ... 3)[2]', X::AdHoc, 'yada operator not confused for sequence operator'; #OK apparent sequence operator
throws-like '(1, 2, ... 3)[2]', Exception, 'yada operator not confused for sequence operator'; #OK apparent sequence operator

# L<S03/List infix precedence/and another function to continue the list>
# chained sequence
Expand Down
4 changes: 2 additions & 2 deletions S04-statements/for.t
Expand Up @@ -164,7 +164,7 @@ my @elems = <a b c d e>;
{
{
my @a = <1 2 3 4>;
throws-like 'for @a -> $elem {$elem = 5}', X::AdHoc,
throws-like 'for @a -> $elem {$elem = 5}', Exception,
'-> $var is ro by default';
}

Expand Down Expand Up @@ -380,7 +380,7 @@ throws-like 'for(0..5) { }', X::Comp::Group, 'keyword needs at least one whitesp

{
my $str = '';
throws-like 'for 1..5 -> $x, $y { $str ~= "$x$y" }', X::AdHoc,
throws-like 'for 1..5 -> $x, $y { $str ~= "$x$y" }', Exception,
'Should throw exception, no value for parameter $y';
is $str, "1234", "loop ran before throwing exception";
#diag ">$str<";
Expand Down
2 changes: 1 addition & 1 deletion S04-statements/terminator.t
Expand Up @@ -48,7 +48,7 @@ throws-like "42 if 23\nis 50; 1", X::Syntax::Confused,
"if postfix modifier and is() is parsed correctly";

# not sure this belong here, suggestions for better places are welcome
throws-like '(1) { $foo = 2 }', X::AdHoc, 'parens do not eat spaces after them';
throws-like '(1) { $foo = 2 }', Exception, 'parens do not eat spaces after them';

# RT #79964
eval-lives-ok q:b"my &f;\nsub g() { }\n&f;", 'implicit terminator before & sigil';
Expand Down
2 changes: 1 addition & 1 deletion S05-grammar/parse_and_parsefile.t
Expand Up @@ -39,7 +39,7 @@ nok(A::B.parse("zzz42zzz"), ".parse works with namespaced grammars, no match");
is(~A::B.parse("42"), "42", ".parse works with namespaced grammars, match");

# TODO: Check for a good error message, not just the absence of a bad one.
throws-like '::No::Such::Grammar.parse()', X::AdHoc, '.parse on missing grammar dies';
throws-like '::No::Such::Grammar.parse()', Exception, '.parse on missing grammar dies';

# RT #71062
{
Expand Down
4 changes: 2 additions & 2 deletions S05-grammar/polymorphism.t
Expand Up @@ -77,11 +77,11 @@ is(~$/, "DeF", '.Yet::Another.def $/');

# Non-existent rules...

throws-like q{ 'abc' ~~ m/ (<Another.sea>) / }, X::AdHoc, '<Another.sea>';
throws-like q{ 'abc' ~~ m/ (<Another.sea>) / }, Exception, '<Another.sea>';

# RT #63466
{
throws-like q{ 'x' ~~ / <No::Such::Rule> / }, X::AdHoc,
throws-like q{ 'x' ~~ / <No::Such::Rule> / }, Exception,
'match against No::Such::Rule dies';
}

Expand Down
4 changes: 2 additions & 2 deletions S05-interpolation/regex-in-variable.t
Expand Up @@ -47,7 +47,7 @@ ok(!('aaaaab' ~~ m/"$foo"/), 'Rulish scalar match 7');

# RT #100232
#?rakudo todo 'escaping characters before EVAL is the wrong way to fix this RT #100232'
throws-like Q[my $x = '1} if say "pwnd"; #'; 'a' ~~ /<$x>/], X::AdHoc, "particular garbage-in recognized as being garbage (see RT)";
throws-like Q[my $x = '1} if say "pwnd"; #'; 'a' ~~ /<$x>/], Exception, "particular garbage-in recognized as being garbage (see RT)";

# because it broke these:
{
Expand All @@ -57,7 +57,7 @@ throws-like Q[my $x = '1} if say "pwnd"; #'; 'a' ~~ /<$x>/], X::AdHoc, "particul
}

#?rakudo todo 'and no need to go all Bobby Tables either RT #124633'
throws-like Q['a' ~~ /<{'$(say "trivially pwned")'}>/], X::AdHoc, "should handle this too";
throws-like Q['a' ~~ /<{'$(say "trivially pwned")'}>/], Exception, "should handle this too";

# Arrays

Expand Down
32 changes: 16 additions & 16 deletions S05-mass/rx.t
Expand Up @@ -311,7 +311,7 @@ ok 'bbccdd' !~~ /<-[b..d]>/, 'negated character range';

#### <-[d..b]> dies
#?niecza todo ""
throws-like '/<-[d..b]>/', X::AdHoc, 'illegal character range';
throws-like '/<-[d..b]>/', Exception, 'illegal character range';

ok '-' ~~ /<[-]>/, 'unescaped hyphen is fine on its own';

Expand Down Expand Up @@ -539,7 +539,7 @@ ok 'az' ~~ /<+alpha>+/, 'metasyntax with leading + (<+...>)';


#### a[b} \t\n\r !"#$%&\'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /rule error/ mismatched close
throws-like '/a[b}/', X::AdHoc, 'mismatched close';
throws-like '/a[b}/', Exception, 'mismatched close';


#### c <before .d> abacad /mob: <c @ 3>/ one character and lookahead <before>
Expand Down Expand Up @@ -854,28 +854,28 @@ ok 'abc' ~~ / | d | b/, 'leading alternation ignored';
throws-like '/ b | | d/', X::Syntax::Regex::NullRegex, 'null pattern invalid';

#### \pabc pabc /reserved/ retired metachars (\p)
throws-like '/\pabc/', X::AdHoc, 'retired metachars (\p)';
throws-like '/\pabc/', Exception, 'retired metachars (\p)';

#### \p{InConsonant} a /reserved/ retired metachars (\p)
throws-like '/\p{InConsonant}/', X::AdHoc, 'retired metachars (\p)';
throws-like '/\p{InConsonant}/', Exception, 'retired metachars (\p)';

#### \Pabc Pabc /reserved/ retired metachars (\P)
throws-like '/\Pabc/', X::AdHoc, 'retired metachars (\P)';
throws-like '/\Pabc/', Exception, 'retired metachars (\P)';

#### \P{InConsonant} a /reserved/ retired metachars (\P)
throws-like '/\P{InConsonant}/', X::AdHoc, 'retired metachars (\P)';
throws-like '/\P{InConsonant}/', Exception, 'retired metachars (\P)';

#### \Labc\E LabcE /reserved/ retired metachars (\L...\E)
throws-like '/\Labc\E/', X::AdHoc, 'retired metachars (\L...\E)';
throws-like '/\Labc\E/', Exception, 'retired metachars (\L...\E)';

#### \LABC\E abc /reserved/ retired metachars (\L...\E)
throws-like '/\LABC\E/', X::AdHoc, 'retired metachars (\L...\E)';
throws-like '/\LABC\E/', Exception, 'retired metachars (\L...\E)';

#### \Uabc\E UabcE /reserved/ retired metachars (\U...\E)
throws-like '/\Uabc\E/', X::AdHoc, 'retired metachars (\U...\E)';
throws-like '/\Uabc\E/', Exception, 'retired metachars (\U...\E)';

#### \Uabc\E ABC /reserved/ retired metachars (\U...\E)
throws-like '/\Uabc\E/', X::AdHoc, 'retired metachars (\U...\E)';
throws-like '/\Uabc\E/', Exception, 'retired metachars (\U...\E)';

#### \Qabc\E QabcE /reserved/ retired metachars (\Q...\E)
throws-like '/\Qabc\E/', X::Obsolete, 'retired metachars (\Q...\E)';
Expand All @@ -884,10 +884,10 @@ throws-like '/\Qabc\E/', X::Obsolete, 'retired metachars (\Q...\E)';
throws-like '/\Qabc d?\E/', X::Obsolete, 'retired metachars (\Q...\E)';

#### \Gabc Gabc /reserved/ retired metachars (\G)
throws-like '/\Gabc/', X::AdHoc, 'retired metachars (\G)';
throws-like '/\Gabc/', Exception, 'retired metachars (\G)';

#### \1abc 1abc /reserved/ retired metachars (\1)
throws-like '/\1abc/', X::AdHoc, 'retired metachars (\1)';
throws-like '/\1abc/', Exception, 'retired metachars (\1)';

#### ^ \s+ $ \x0009\x0020\x00a0\x000a\x000b\x000c\x000d\x0085 y 0-255 whitespace (\s)
ok "\x0009\x0020\x00a0\x000a\x000b\x000c\x000d\x0085" ~~ /^ \s+ $/, '0-255 whitespace (\s)';
Expand Down Expand Up @@ -2315,13 +2315,13 @@ ok 'aJc' !~~ /^<+alpha-[Jj]>+$/, 'character class with no j fail';
throws-like '/{{/', X::Comp::Group, 'unterminated closure';

#### \1 abcdef /reserved/ back references
throws-like '/\1/', X::AdHoc, 'back references';
throws-like '/\1/', Exception, 'back references';

#### \x[ abcdef /Missing close bracket/ unterminated \x[..]
throws-like '/\x[/', X::AdHoc, 'unterminated \x[..]';
throws-like '/\x[/', Exception, 'unterminated \x[..]';

#### \X[ abcdef /Missing close bracket/ unterminated \X[..]
throws-like '/\X[/', X::AdHoc, 'unterminated \X[..]';
throws-like '/\X[/', Exception, 'unterminated \X[..]';


#### * abc abcdef /Quantifier follows nothing/ bare * at start
Expand Down Expand Up @@ -2392,6 +2392,6 @@ throws-like '"b" ~~ /b| /', X::Syntax::Regex::NullRegex, 'null pattern after alt

# RT #71702
#?niecza todo 'allows them'
throws-like '"foo" ~~ /<[d..b]>? foo/', X::AdHoc, 'no reversed char ranges';
throws-like '"foo" ~~ /<[d..b]>? foo/', Exception, 'no reversed char ranges';

# vim: ft=perl6 sw=4 expandtab
8 changes: 4 additions & 4 deletions S05-metasyntax/angle-brackets.t
Expand Up @@ -131,9 +131,9 @@ character classes), and those are referenced at the correct spot.

# No other characters are allowed after the initial identifier.
{
throws-like '"foo" ~~ /<test*>/', X::AdHoc, 'no other characters are allowed (*)';
throws-like '"foo" ~~ /<test|>/', X::AdHoc, 'no other characters are allowed (|)';
throws-like '"foo" ~~ /<test&>/', X::AdHoc, 'no other characters are allowed (&)';
throws-like '"foo" ~~ /<test*>/', Exception, 'no other characters are allowed (*)';
throws-like '"foo" ~~ /<test|>/', Exception, 'no other characters are allowed (|)';
throws-like '"foo" ~~ /<test&>/', Exception, 'no other characters are allowed (&)';
# TODO currently fails with "Method 'test' not found for invocant of class 'Cursor'"
throws-like '"foo" ~~ /<test:>/', Exception, 'no other characters are allowed (:)';
}
Expand Down Expand Up @@ -262,7 +262,7 @@ character classes), and those are referenced at the correct spot.
# XXX: Should be warns_ok, but we don't have that yet
lives-ok({'foo' ~~ /<???>/}, '<???> lives in regex match');
#?rakudo todo '!!! in regexes'
throws-like '"foo" ~~ /<!!!>/', X::AdHoc, '<!!!> dies in regex match';
throws-like '"foo" ~~ /<!!!>/', Exception, '<!!!> dies in regex match';
}
# A leading * indicates that the following pattern allows a partial match.
Expand Down
8 changes: 4 additions & 4 deletions S05-metasyntax/charset.t
Expand Up @@ -65,16 +65,16 @@ ok( "foo" ~~ /<[f] #`[comment] + [o]>/, 'comment embedded in charset works' );
ok "\x[FFEF]" ~~ /<[\x0..\xFFEF]>/, 'large \\x char spec';

#?niecza todo
throws-like "'RT #71702' ~~ /<[d..b]>? RT/", X::AdHoc,
throws-like "'RT #71702' ~~ /<[d..b]>? RT/", Exception,
'reverse range in charset is lethal (RT #71702)';

throws-like "'x' ~~ /<[abc] [def]>? RT/", X::AdHoc,
throws-like "'x' ~~ /<[abc] [def]>? RT/", Exception,
'missing + or - is fatal 1';

throws-like "'x' ~~ /<:Kata :Hira]>? RT/", X::AdHoc,
throws-like "'x' ~~ /<:Kata :Hira]>? RT/", Exception,
'missing + or - is fatal 2';

throws-like "'x' ~~ /<+alpha digit]>? RT/", X::AdHoc,
throws-like "'x' ~~ /<+alpha digit]>? RT/", Exception,
'missing + or - is fatal 3';

# RT #64220
Expand Down
2 changes: 1 addition & 1 deletion S05-metasyntax/regex.t
Expand Up @@ -11,7 +11,7 @@ throws-like 'rx(o)', X::Undeclared::Symbols,
'rx () requires whitespace if the delims are parens';
isa-ok(regex {oo}, Regex);

throws-like 'rx :foo:', X::AdHoc, 'colons are not allowed as rx delimiters';
throws-like 'rx :foo:', Exception, 'colons are not allowed as rx delimiters';

lives-ok { my Regex $x = rx/foo/ }, 'Can store regexes in typed variables';

Expand Down
2 changes: 1 addition & 1 deletion S05-metasyntax/unknown.t
Expand Up @@ -12,7 +12,7 @@ throws-like '"aa!" ~~ /!/', X::Syntax::Regex::UnrecognizedMetachar,
lives-ok({"aa!" ~~ /\!/}, 'escaped "!" is valid');
lives-ok({"aa!" ~~ /'!'/}, 'quoted "!" is valid');

throws-like '"aa!" ~~ /\a/', X::AdHoc, 'escaped "a" is not valid metasyntax';
throws-like '"aa!" ~~ /\a/', Exception, 'escaped "a" is not valid metasyntax';
lives-ok({"aa!" ~~ /a/}, '"a" is valid');
lives-ok({"aa!" ~~ /'a'/}, 'quoted "a" is valid');

Expand Down
4 changes: 2 additions & 2 deletions S05-syntactic-categories/new-symbols.t
Expand Up @@ -11,14 +11,14 @@ plan 8;
augment slang Regex {
token backslash:sym<Y> { YY };
}
throws-like '/foo \y/', X::AdHoc,
throws-like '/foo \y/', Exception,
'can not compile regex with unknown backslash rule';
eval-lives-ok '/fuu \Y/', 'can compile a regex with new backslash rule';
ok 'YY' ~~ /^\Y$/, 'can use that rule (positive)';
ok 'yX' !~~ /^\Y$/, 'can use that rule (negative)';
}
#?rakudo skip "RT #126142 - NYI"
throws-like '/\Y/', X::AdHoc, 'backslash rules are lexically scoped';
throws-like '/\Y/', Exception, 'backslash rules are lexically scoped';

#?rakudo skip "RT #126142 - NYI"
{
Expand Down
2 changes: 1 addition & 1 deletion S06-multi/proto.t
Expand Up @@ -47,7 +47,7 @@ multi bar(| where { $_[0] == 42 }) { 1 } #OK not used
is(bar(A.new), 2, 'dispatch on class worked (anon cap)');
is(bar(B.new), 3, 'dispatch on class worked (anon cap)');
is(bar(42), 1, 'dispatch with no possible candidates fell back to proto (anon cap)');
throws-like 'bar(41)', X::AdHoc, 'impossible dispatch failed (anon cap)';
throws-like 'bar(41)', Exception, 'impossible dispatch failed (anon cap)';

# RT #65322
{
Expand Down
4 changes: 2 additions & 2 deletions S06-parameters/smiley.t
Expand Up @@ -9,9 +9,9 @@ is { sub a(Int:_ $a) { $a }; a Int }(), Int, 'can Int:_ take an Int:U';
is { sub a(Int:_ $a) { $a }; a 42 }(), 42, 'can Int:_ take an Int:D';
is { sub a(Int:U $a) { $a }; a Int }(), Int, 'can Int:U take an Int:U';
throws-like { sub a(Int:U $a) { $a }; a 42 },
X::AdHoc, 'can Int:U take an Int:D';
Exception, 'can Int:U take an Int:D';
throws-like { sub a(Int:D $a) { $a }; a Int },
X::AdHoc, 'can Int:D take an Int:U';
Exception, 'can Int:D take an Int:U';
is { sub a(Int:D $a) { $a }; a 42 }(), 42, 'can Int:D take an Int:D';
throws-like 'sub a(Int:foo $a) { $a }',
X::InvalidTypeSmiley, 'does Int:foo fail';
Expand Down

0 comments on commit 19c27b7

Please sign in to comment.