Skip to content

Commit

Permalink
Revert "Throws X::Multi::NoMatch if a proto routine is defined withou…
Browse files Browse the repository at this point in the history
…t multis."
  • Loading branch information
AlexDaniel committed Aug 21, 2018
1 parent 3117cfd commit 397e230
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
7 changes: 2 additions & 5 deletions src/Perl6/Optimizer.nqp
Expand Up @@ -2531,14 +2531,11 @@ class Perl6::Optimizer {
%opts<protoguilt> := $protoguilt // nqp::p6bool(0);
%opts<arguments> := @arg_names;
%opts<objname> := $obj.name;
%opts<dispatcher> := $obj;
%opts<signature> := nqp::can($obj, 'is_dispatcher') && $obj.is_dispatcher && !$protoguilt ??
multi_sig_list($obj) !!
[try $obj.signature.gist];
nqp::if( nqp::can($obj, 'is_dispatcher') && $obj.is_dispatcher && nqp::elems($obj.dispatchees) == 0,
$!problems.add_exception(['X', 'Multi', 'NoMatch'], $op, |%opts),
$!problems.add_exception(['X', 'TypeCheck', 'Argument'], $op, |%opts)
);

$!problems.add_exception(['X', 'TypeCheck', 'Argument'], $op, |%opts);
}

# Signature list for multis.
Expand Down
7 changes: 1 addition & 6 deletions t/05-messages/01-errors.t
Expand Up @@ -2,7 +2,7 @@ use lib <t/packages/>;
use Test;
use Test::Helpers;

plan 49;
plan 48;

# RT #129763
throws-like '1++', X::Multi::NoMatch,
Expand Down Expand Up @@ -198,11 +198,6 @@ throws-like { class { proto method x(|) {*} }.new.x }, X::Multi::NoMatch,
:message{ .contains: 'only the proto' & none 'none of these signatures' },
'error points out only only proto is defined';

# GH #1746
throws-like { EVAL 'proto x(|) {*}; x' }, X::Multi::NoMatch,
:message{ .contains: 'only the proto' & none 'none of these signatures' },
'error points out only only proto routine is defined';

# RT #131367
throws-like { Blob.split }, X::Multi::NoMatch,
:message{ .contains: 'only the proto' & none 'none of these signatures' },
Expand Down

0 comments on commit 397e230

Please sign in to comment.