Skip to content

Commit

Permalink
X::Multi::NoMatch correctly shows named arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Oct 3, 2016
1 parent a7fe6b6 commit 000b930
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion integration/error-reporting.t
Expand Up @@ -2,7 +2,7 @@ use v6;
use lib 't/spec/packages';

use Test;
plan 27;
plan 28;

use Test::Util;

Expand Down Expand Up @@ -211,4 +211,18 @@ throws-like ‘%::{''}’, X::Undeclared, line => /^\d+$/,
is_run '...', {:out(''), :err{ not $^o.contains: 'Unhandled exception' }},
'stub code must not produce `Unhandled exception` message';

# RT #129800
subtest 'X::Multi::NoMatch correct shows named arguments' => {
my class RT129800 { multi method foo ($) {} }
throws-like { RT129800.foo: :foo(42) }, X::Multi::NoMatch,
message => /':foo(Int)'/, 'message mentions our positional';
throws-like { RT129800.foo: :foo("meow") }, X::Multi::NoMatch,
message => /':foo(Str)'/, 'type of named is correct';
throws-like { RT129800.foo: :foo(my class Foo {}) }, X::Multi::NoMatch,
message => /':foo(Foo)'/, 'custom types detected';
throws-like { RT129800.foo: :foo(my class Foo {method perl {die}}) },
X::Multi::NoMatch, message => /':Foo'/,
'fallback mechanism works';
}

# vim: ft=perl6

0 comments on commit 000b930

Please sign in to comment.