Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Start updating S12-methods/multi.t for current semantics.
  • Loading branch information
jnthn committed Sep 12, 2011
1 parent ff5b76b commit 48a5530
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions S12-methods/multi.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 35;
plan 34;

# L<S12/"Multisubs and Multimethods">
# L<S12/"Trusts">
Expand Down Expand Up @@ -36,8 +36,7 @@ is($foo.bar(), 'Foo.bar() called with no args', '... multi-method dispatched on
is($foo.bar("Hello"), 'Foo.bar() called with Str : Hello', '... multi-method dispatched on Str');

is($foo.bar(5), 'Foo.bar() called with Int : 5', '... multi-method dispatched on Int');
my $num = '4';
is($foo.bar(+$num), 'Foo.bar() called with Numeric : 4', '... multi-method dispatched on Numeric');
is($foo.bar(4.2), 'Foo.bar() called with Numeric : 4.2', '... multi-method dispatched on Numeric');

#?rakudo todo 'RT #66006'
eval '$foo.baz()';
Expand All @@ -51,10 +50,9 @@ role R2 {
}
eval_dies_ok 'class X does R1 does R2 { }', 'sanity: get composition conflict error';
class C does R1 does R2 {
proto method foo() { "proto" }
proto method foo() { * }
}
my $obj = C.new;
is($obj.foo(), 'proto', 'proto caused methods from roles to be composed without conflict');
#?rakudo 2 skip 'proto does not promote to multi'
is($obj.foo('a'), 1, 'method composed into multi from role called');
is($obj.foo('a','b'), 2, 'method composed into multi from role called');
Expand Down

0 comments on commit 48a5530

Please sign in to comment.