develooper Front page | perl.moose | Postings from March 2009

Not inlining a constructor warning

Thread Next
March 12, 2009 08:34
Not inlining a constructor warning
Message ID:

Hi all,

Question:  What's the proper way to suppress the following error from Moose::Meta::Method::Constructor when __PACKAGE->meta->make_immutable is called?

  Not inlining a constructor for PIPs::ResultSourceBase::BrandSeries since it is not inheriting the default Moose::Object constructor

(make_immutable might not even be necessary  Does this impact the role methods composed into classes which don't use Moose directly?)

Background, if needed:

We're gradually eliminating inheritance by converting subclasses to Moose roles.  Background at:

We're converting stuff like this:

  package PIPs::ResultSource::Promotion;
  use base qw/

To stuff like this:

  package PIPs::ResultSource::Promotion;
  use base 'PIPs::ResultSourceBase::AuditedObject';

  use Moose;
  with 'PIPs::ResultSource::Role::HasIdentifiers';

(Yes, we know about 'extends', but we have a large, mission-critical app and we're taking deliberate baby steps in this large refactoring).

However, at the bottom of our code, we tried to put:


And we were getting errors:

  Can't locate object method "BUILDARGS" via package "PIPs::ResultSource::Promotion" at 
  /home/poec01/branches/broadcast_search/deps/lib/perl5/Moose/ line 16.

This was because Moose 0.61 was inlining a constructor and overwriting ours.  Upgrading to Moose 0.62 solved this, but it appears that the warning about "Not inlining a constructor" appears anyway and this makes for a very messy test suite.

With over 500 classes, we're not in a position to just switch over to the full Moose Kool-Aid (which seems like the proper fix), so is there a recommend way to handle this while we gradually refactor?

Buy the book         -
Tech blog            -
Twitter              -
Official Perl 6 Wiki -

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About