Skip Menu |

This queue is for tickets about the Moose CPAN distribution.

Report information
The Basics
Id: 71769
Status: new
Priority: 0/
Queue: Moose

Owner: Nobody in particular
Requestors: sherwind [...]

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

Subject: parameterized metaclass trait creates a warning
Date: Wed, 19 Oct 2011 11:44:48 +0800
To: bug-Moose [...]
From: Sherwin Daganato <sherwind [...]>
Download (untitled) / with headers
text/plain 2.1k
In Moose-2.0205, a bug that caused a warning when passing options to an attribute trait has been fixed. Should the same be done with metaclass trait? This no longer creates a warning: $ perl -MCarp::Always -MMoose -e 'package R; use Moose::Role; package C; use Moose; has attr => (is => "ro", traits => [R => { foo => 1 }])' But this one does: $ perl -MCarp::Always -MMoose -e 'package R; use Moose::Role; package C; use Moose -traits => [R => { foo => 1 }]' Roles with parameters cannot be cached. Consider applying the parameters before calling create_anon_class, or using 'weaken => 0' instead at /Users/sherwind/perl5/lib/perl5/darwin-thread-multi-2level/Moose/Meta/ line 145 Moose::Meta::Class::_anon_cache_key('Moose::Meta::Class', 'roles', 'ARRAY(0x8e17a4)', 'weaken', '', 'superclasses', 'ARRAY(0xa25c40)') called at /Users/sherwind/perl5/lib/perl5/darwin-thread-multi-2level/Class/MOP/ line 109 Class::MOP::Package::create_anon('Moose::Meta::Class', 'superclasses', 'ARRAY(0xa25c40)', 'roles', 'ARRAY(0x8e17a4)', 'cache', 1) called at /Users/sherwind/perl5/lib/perl5/darwin-thread-multi-2level/Class/MOP/ line 473 Class::MOP::Class::create_anon_class('Moose::Meta::Class', 'superclasses', 'ARRAY(0xa25c40)', 'roles', 'ARRAY(0x8e17a4)', 'cache', 1) called at /Users/sherwind/perl5/lib/perl5/darwin-thread-multi-2level/Moose/Util/ line 134 Moose::Util::MetaRole::_make_new_class('Moose::Meta::Class', 'ARRAY(0x8e17a4)') called at /Users/sherwind/perl5/lib/perl5/darwin-thread-multi-2level/Moose/Util/ line 79 Moose::Util::MetaRole::_make_new_metaclass('Moose::Meta::Class=HASH(0xa1fbe0)', 'HASH(0xa25be0)', 'class') called at /Users/sherwind/perl5/lib/perl5/darwin-thread-multi-2level/Moose/Util/ line 28 Moose::Util::MetaRole::apply_metaroles('class_metaroles', 'HASH(0xa25be0)', 'for', 'C') called at /Users/sherwind/perl5/lib/perl5/darwin-thread-multi-2level/Moose/ line 523 Moose::Exporter::_apply_meta_traits('C', 'ARRAY(0xa2594c)') called at /Users/sherwind/perl5/lib/perl5/darwin-thread-multi-2level/Moose/ line 434 Moose::Exporter::__ANON__('Moose') called at -e line 1 C::BEGIN() called at -e line 1 eval {...} called at -e line 1

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to