Skip Menu |

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

Report information
The Basics
Id: 53070
Status: open
Priority: 0/
Queue: MooseX-Role-TraitConstructor

People
Owner: Nobody in particular
Requestors: m.nooning [...] comcast.net
Cc: KENTNL [...] cpan.org
AdminCc:

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



Subject: Failed test 'nonexistent trait' with Bizarre copy of HASH
I am trying to install MooseX::Role::TraitConstructor on Windows XP, ActiveState Perl 5.8.8 Bizarre copy of HASH in sassign at C:/Perl/lib/Carp/Heavy.pm line 104. C:\temp\MooseX-Role-TraitConstructor-0.01>nmake test Microsoft (R) Program Maintenance Utility Version 7.00.9466 Copyright (C) Microsoft Corporation. All rights reserved. C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t/*.t t/basic.t .. 1/? # Failed test 'nonexistent trait' # at t/basic.t line 68. # expecting: Regexp ((?i-xsm:load.*Does::Not::Exist)) # found: Bizarre copy of HASH in sassign at C:/Perl/lib/Carp/Heavy.pm line 104. # Failed test 'not a trait' # at t/basic.t line 70. # expecting: Regexp ((?i-xsm:not a moose role)) # found: Bizarre copy of HASH in sassign at C:/Perl/lib/Carp/Heavy.pm line 104. # Looks like you failed 2 tests of 14.
It appears that the bug is caused by http://rt.perl.org/rt3/Public/Bug/Display.html?id=52610 Simply localizing @DB::args appears to suppress the Carp failure temporarily till somebody fixes The Real Bug™ ( Its likely to have side effects somebody doesn't want however ). <snip> if ( @traits = $class->process_constructor_traits($params, @$traits)) { local @DB::args; my $anon_class = Moose::Meta::Class->create_anon_class( superclasses => [ $class ], roles => [ @traits ], cache => 1, ); $class = $anon_class->name; } </snip> <snip> local @DB::args; require Carp; Carp::croak("Couldn't load $trait" . ( $processed_trait ? " or $processed_trait" : "" ) . " to mix in with $class" . ( $class->meta->is_anon_class ? " ($possible_root)" : "" )); } </snip> These 2 minor changes for me make the failing tests pass again.