Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the MooseX-Aliases CPAN distribution.

Report information
The Basics
Id: 67733
Status: open
Priority: 0/
Queue: MooseX-Aliases

People
Owner: Nobody in particular
Requestors: GENEHACK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.09
Fixed in: (no value)



Subject: Can't declare alias in attribute modifier
Using Moose 2.0001 and MX::Aliases 0.09, the attached code dies with this error: Found unknown argument(s) passed to 'id' attribute constructor in 'Moose::Meta::Attribute': alias at /opt/perl/perls/perl-5.14.0-RC1/lib/site_perl/5.14.0/darwin- 2level/Moose/Meta/Attribute.pm line 78 Putting 'use MooseX::Alias' in the parent class fixes the problem, but if you want to alias something in code you're subclassing and don't control, that's not really an option.
Subject: try.pl
#! /opt/perl/bin/perl use strict; use warnings; package MyBase; use Moose; # uncomment the following and this works #use MooseX::Aliases; has 'id' => ( is => 'ro' , required => 1, ); package MyChild; use Moose; extends 'MyBase'; use MooseX::Aliases; has '+id' => ( alias => 'name' ); package main; my $child = MyChild->new({ name => 'test' }); print $child->name;
For what it's worth, this is an issue with Moose - there's not really much MooseX::Aliases can do to work around it. I'll leave the ticket open though, because it is a bit irritating.