moose / MooseX-StrictConstructor

Make your object constructors blow up on unknown attributes
https://metacpan.org/pod/MooseX::StrictConstructor
Other
1 stars 1 forks source link

does not handle __no_BUILD__ #3

Closed autarch closed 7 years ago

autarch commented 7 years ago

Migrated from rt.cpan.org #120124 (status was 'new')

Requestors:

From ether@cpan.org (@karenetheridge) on 2017-02-06 20:32:43:

When a Moo class subclasses a Moose class that uses MooseX::StrictConstructor, MXSC blows up on the unexpected __no_BUILD__ argument passed to the constructor.

# lib/Parent.pm
package Parent;
use Moose;
use MooseX::StrictConstructor;
1;

# lib/Child.pm
package Parent;
package Child;
use Moo;
extends 'Parent';
1;

: [ether@jaeger git/Moose]$; perl -Mblib -MChild -wle'print Child->new()'
Found unknown attribute(s) init_arg passed to the constructor: __no_BUILD__ at /Volumes/amaretto/Users/ether/git/Moose/blib/lib/Class/MOP/Object.pm line 14
        Class::MOP::Object::throw_error('Moose::Meta::Class::__ANON__::SERIAL::1=HASH(0x7f84bca8d668)', 'Found unknown attribute(s) init_arg passed to the constructor: __no_BUILD__') called at /Volumes/amaretto/Users/ether/.perlbrew/libs/25.9@std/lib/perl5/MooseX/StrictConstructor/Trait/Class.pm line 29
        Class::MOP::Class:::around('CODE(0x7f84bbdcb5a8)', 'Moose::Meta::Class::__ANON__::SERIAL::1=HASH(0x7f84bca8d668)', 'HASH(0x7f84bca93300)') called at /Volumes/amaretto/Users/ether/git/Moose/blib/lib/Class/MOP/Method/Wrapped.pm line 164
        Moose::Meta::Class::__ANON__::SERIAL::1::_wrapped_new_object('Moose::Meta::Class::__ANON__::SERIAL::1=HASH(0x7f84bca8d668)', 'HASH(0x7f84bca93300)') called at /Volumes/amaretto/Users/ether/git/Moose/blib/lib/Class/MOP/Method/Wrapped.pm line 95
        Moose::Meta::Class::__ANON__::SERIAL::1::new_object('Moose::Meta::Class::__ANON__::SERIAL::1=HASH(0x7f84bca8d668)', 'HASH(0x7f84bca93300)') called at /Volumes/amaretto/Users/ether/.perlbrew/libs/25.9@std/lib/perl5/Moo/HandleMoose/FakeMetaClass.pm line 16
        Moo::HandleMoose::FakeMetaClass::AUTOLOAD('Moo::HandleMoose::FakeMetaClass=HASH(0x7f84bb9cad40)', 'HASH(0x7f84bca93300)') called at /Volumes/amaretto/Users/ether/git/Moose/blib/lib/Moose/Object.pm line 24
        Moose::Object::new('Child', 'HASH(0x7f84bca932b8)') called at (eval 184) line 36
        Child::new('Child') called at -e line 1
autarch commented 7 years ago

From ether@cpan.org (@karenetheridge) on 2017-02-08 23:30:04:

On 2017-02-06 12:32:43, ETHER wrote:

When a Moo class subclasses a Moose class that uses MooseX::StrictConstructor, MXSC blows up on the unexpected __no_BUILD__ argument passed to the constructor.

patched in https://github.com/moose/MooseX-StrictConstructor/pull/1

autarch commented 7 years ago

Fixed in 0.20.