From: Tomas Doran Date: Sun, 15 Jul 2012 11:19:42 +0000 (+0100) Subject: Fail with namespace::autoclean X-Git-Tag: v1.000000~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=44a44498b0bef2040298807d349a879d4a790d1a;p=gitmo%2FMoo.git Fail with namespace::autoclean --- diff --git a/xt/lib/withautoclean/Class.pm b/xt/lib/withautoclean/Class.pm new file mode 100644 index 0000000..ad0f397 --- /dev/null +++ b/xt/lib/withautoclean/Class.pm @@ -0,0 +1,10 @@ +package withautoclean::Class; +use Moo; + +with 'withautoclean::R1'; + +before _clear_ctx => sub { +}; + +1; + diff --git a/xt/lib/withautoclean/R1.pm b/xt/lib/withautoclean/R1.pm new file mode 100644 index 0000000..f2fc608 --- /dev/null +++ b/xt/lib/withautoclean/R1.pm @@ -0,0 +1,18 @@ +package withautoclean::R1; +use Moo::Role; + +# Doing this (or loading a class which is built with Moose) +# and then loading autoclean - everything breaks... +use Moose (); +use namespace::autoclean; +# Wouldn't happen normally, but is likely to as you part-port something. + +has _ctx => ( + is => 'ro', + default => sub { + }, + clearer => '_clear_ctx', +); + +1; + diff --git a/xt/withautoclean.t b/xt/withautoclean.t new file mode 100644 index 0000000..6d9e807 --- /dev/null +++ b/xt/withautoclean.t @@ -0,0 +1,10 @@ +use strict; +use warnings; +use FindBin qw/ $Bin /; +use lib "$Bin/lib"; +use Test::More; + +use_ok 'withautoclean::Class'; + +done_testing; +