Skip Menu |

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

Report information
The Basics
Id: 74143
Status: open
Priority: 0/
Queue: MooseX-Declare

People
Owner: Nobody in particular
Requestors: sp [...] smartspb.net
Cc:
AdminCc:

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



Subject: Strange MooseX::Declare behaivior
Date: Thu, 19 Jan 2012 11:56:54 +0400
To: bug-MooseX-Declare [...] rt.cpan.org
From: Sergey Potapov <sp [...] smartspb.net>
Hello! Summary of strange things (perl 5.14.2 installed with perlbrew, latest or almost latest Moose and MooseX::Declare installed using cpanm): sp@uskr:~/w$ cat strange_moosex_declare.pl use MooseX::Declare; class nom2 # Cannot find method 'm2' { method m1 { 1 } method m2 { 2 } } class nom3 # Cannot find method 'm3' { method m1 { 1 } method m2 { 2 } method m3 { 3 } } class okm2 # All methods ok { method m1 { 1 } method m2 { 2 } } class okm3 # All methods ok { method m1 { 1 } method m2 { 2 } method m3 { 3 } } my $nom2 = nom2->new; my $nom3 = nom3->new; my $okm2 = okm2->new; my $okm3 = okm3->new; print "\nStrange classes\n\n"; eval { print "nom2->m1 returns ", $nom2->m1, "\n"; } or do { print "nom2->m1 failed: ", $@; }; eval { print "nom2->m2 returns ", $nom2->m2, "\n"; } or do { print "nom2->m2 failed: ", $@; }; eval { print "nom3->m1 returns ", $nom3->m1, "\n"; } or do { print "nom3->m1 failed: ", $@; }; eval { print "nom3->m2 returns ", $nom3->m2, "\n"; } or do { print "nom3->m2 failed: ", $@; }; eval { print "nom3->m3 returns ", $nom3->m3, "\n"; } or do { print "nom3->m3 failed: ", $@; }; print "\nOk classes\n\n"; eval { print "okm2->m1 returns ", $okm2->m1, "\n"; } or do { print "okm2->m1 failed: ", $@; }; eval { print "okm2->m2 returns ", $okm2->m2, "\n"; } or do { print "okm2->m2 failed: ", $@; }; eval { print "okm3->m1 returns ", $okm3->m1, "\n"; } or do { print "okm3->m1 failed: ", $@; }; eval { print "okm3->m2 returns ", $okm3->m2, "\n"; } or do { print "okm3->m2 failed: ", $@; }; eval { print "okm3->m3 returns ", $okm3->m3, "\n"; } or do { print "okm3->m3 failed: ", $@; }; print "\nVersions:\n\n"; print " Moose ", Moose->VERSION, "\n"; print " MooseX::Declare ", MooseX::Declare->VERSION, "\n"; print " Perl\n", `perl -V`; 1; __END__ # perl -w strange_moosex_declare.pl >> strange_moosex_declare.pl Strange classes nom2->m1 returns 1 nom2->m2 failed: Can't locate object method "m2" via package "nom2" at strange_moosex_declare.pl line 64. nom3->m1 returns 1 nom3->m2 returns 2 nom3->m3 failed: Can't locate object method "m3" via package "nom3" at strange_moosex_declare.pl line 79. Ok classes okm2->m1 returns 1 okm2->m2 returns 2 okm3->m1 returns 1 okm3->m2 returns 2 okm3->m3 returns 3 Versions: Moose 2.0401 MooseX::Declare 0.35 Perl Summary of my perl5 (revision 5 version 14 subversion 2) configuration: Platform: osname=linux, osvers=2.6.32-5-amd64, archname=x86_64-linux uname='linux uskr 2.6.32-5-amd64 #1 smp thu nov 3 03:41:26 utc 2011 x86_64 gnulinux ' config_args='-de -Dprefix=/home/sp/perl5/perlbrew/perls/perl-5.14.2' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.4.5', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib /lib64 /usr/lib64 libs=-lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.11.2.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.11.2' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector' Characteristics of this binary (from libperl): Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF Built under linux Compiled at Dec 19 2011 16:11:12 %ENV: PERLBREW_BASHRC_VERSION="0.36" PERLBREW_HOME="/home/sp/.perlbrew" PERLBREW_MANPATH="/home/sp/perl5/perlbrew/perls/perl-5.14.2/man" PERLBREW_PATH="/home/sp/perl5/perlbrew/bin:/home/sp/perl5/perlbrew/perls/perl-5.14.2/bin" PERLBREW_PERL="perl-5.14.2" PERLBREW_ROOT="/home/sp/perl5/perlbrew" PERLBREW_VERSION="0.36" @INC: /home/sp/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/x86_64-linux /home/sp/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2 /home/sp/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/x86_64-linux /home/sp/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2 . sp@uskr:~/w$ # --- begin perl --- use MooseX::Declare; # This works class foo { method foo_first { } ... method foo_last_but_one { } method foo_last } # This cannot find method bar_last class bar { method bar_first { } ... method bar_last_but_one { } method bar_last { } } # --- end perl --- Complete example script with output:
Subject: Re: [rt.cpan.org #74143] Strange MooseX::Declare behaivior
Date: Thu, 19 Jan 2012 09:40:46 -0800
To: Sergey Potapov via RT <bug-MooseX-Declare [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Thu, Jan 19, 2012 at 02:57:25AM -0500, Sergey Potapov via RT wrote: Show quoted text
> Summary of strange things (perl 5.14.2 installed with perlbrew, > latest or almost latest Moose and MooseX::Declare installed using > cpanm):
What version of Devel::Declare are you running? Does upgrading to latest make any difference? Try playing around with whitespace and see if it helps - e.g. see https://rt.cpan.org/Ticket/Display.html?id=71528 and similar open tickets in the MXMS queue (both MooseX::Declare and MooseX::Method::Signatures use Devel::Declare). If we can confirm that the latest version of DD still has issues, then this can be escalated to its maintainers; the issue has happened before and was believed to be fixed.
Subject: Re: [rt.cpan.org #74143] Strange MooseX::Declare behaivior
Date: Fri, 20 Jan 2012 18:13:23 +0400
To: bug-MooseX-Declare [...] rt.cpan.org
From: Sergey Potapov <sp [...] smartspb.net>
19.01.2012 21:41, Karen Etheridge via RT пишет: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=74143> > > On Thu, Jan 19, 2012 at 02:57:25AM -0500, Sergey Potapov via RT wrote:
>> Summary of strange things (perl 5.14.2 installed with perlbrew, >> latest or almost latest Moose and MooseX::Declare installed using >> cpanm):
> > What version of Devel::Declare are you running? > Does upgrading to latest make any difference?
Devel::Declare version is 0.006008 sp@uskr:~$ perl -w use Devel::Declare; print(Devel::Declare->VERSION, "\n"); 0.006008 sp@uskr:~$ It seems to be latest version available. The same problem arises when using MooseX::Method::Signatures. # --- begin test file --- # cat t/00-lang/02-method-signatures.t use Test::More tests => 6; use Test::Exception; { package Fails; use Moose; use MooseX::Method::Signatures; use namespace::autoclean; method m1 ( ) { 1 } method m2 ( ) { 2 } no Moose; __PACKAGE__->meta->make_immutable; 1; } { package Works; use Moose; use MooseX::Method::Signatures; use namespace::autoclean; method m1 ( ) { 1 } method m2 ( ) { 2 } no Moose; __PACKAGE__->meta->make_immutable; 1; } my $works = new_ok 'Works', [], '$works = Works->new; ok'; my $fails = new_ok 'Fails', [], '$fails = Fails->new; ok'; is $works->m1, 1, '$works->m1 works'; is $works->m2, 2, '$works->m2 works'; is $fails->m1, 1, '$fails->m1 works'; throws_ok { $fails->m2 } qr/locate object method/, '$fails->m2 throws "Cannot locate method"'; # --- end of test file --- sp@uskr:~/w$ prove -v t/00-lang/02-method-signatures.t t/00-lang/02-method-signatures.t .. 1..6 ok 1 - $works = Works->new; ok isa Works ok 2 - $fails = Fails->new; ok isa Fails ok 3 - $works->m1 works ok 4 - $works->m2 works ok 5 - $fails->m1 works ok 6 - $fails->m2 throws "Cannot locate method" ok All tests successful. Files=1, Tests=6, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.58 cusr 0.01 csys = 0.61 CPU) Result: PASS sp@uskr:~/w$ Show quoted text
> > Try playing around with whitespace and see if it helps - e.g. see > https://rt.cpan.org/Ticket/Display.html?id=71528 and similar open tickets > in the MXMS queue (both MooseX::Declare and MooseX::Method::Signatures use > Devel::Declare). > > If we can confirm that the latest version of DD still has issues, then this > can be escalated to its maintainers; the issue has happened before and was > believed to be fixed. > > > > >