Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (25 sloc) 0.518 kB
use v6;
use Test;
plan 3;
# L<S13/Syntax/This can easily be handled with Perl 6's aliasing>
class Foo {
method bar() { 42 }
method bar_ref() { &bar }
}
{
my $foo = Foo.new;
lives_ok { $foo.bar_ref }, "returning a method reference works";
}
class Baz {
method bar() { 42 }
our &baz ::= &bar;
}
{
my $ret;
lives_ok {
my $baz = Baz.new;
$ret = $baz.baz();
}, "calling an aliased method worked";
is $ret, 42, "the aliased method returned the right thing";
}
# vim: ft=perl6
Jump to Line
Something went wrong with that request. Please try again.