Skip to content

Commit 38eaa62

Browse files
committed
test a proto that does not redispatch to its multis
1 parent bb17bbe commit 38eaa62

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

S06-multi/proto.t

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use v6;
22
use Test;
3-
plan 23;
3+
plan 25;
44

55
# Test for proto definitions
66
class A { }
@@ -123,6 +123,14 @@ eval_dies_ok 'proto rt68242($a){};proto rt68242($c,$d){};',
123123
is cached('b'), 'bb', 'caching proto (2)';
124124
is cached('a'), 'aa', 'caching proto (3)';
125125
is $called_with, 'ab', 'cached value did not cause extra call';
126+
127+
proto maybe($a) {
128+
$a > 0 ?? {*} !! 0;
129+
}
130+
multi maybe($a) { $a };
131+
132+
is maybe(8), 8, 'sanity';
133+
is maybe(-5), 0, "It's ok not to dispatch to the multis";
126134
}
127135

128136
done;

0 commit comments

Comments
 (0)