Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot alias parent attr from child class? #8

Open
iynehz opened this issue Apr 16, 2018 · 0 comments
Open

Cannot alias parent attr from child class? #8

iynehz opened this issue Apr 16, 2018 · 0 comments

Comments

@iynehz
Copy link

iynehz commented Apr 16, 2018

Is it possible to alias a parent class attr from child class? Below would give Found unknown argument 'alias' in the has declaration for 'foo' in class Bar.

use 5.020;
use warnings;

package Foo {
    use Moose;
    has foo => (is => 'ro');
}

package Bar {
    use Moose;
    use MooseX::Aliases;
    extends 'Foo';
    has '+foo' => (alias => 'baz');
}

my $bar = Bar->new( baz => 1);
say $bar->foo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant