Toby Inkster avatar Toby Inkster committed e6fc0b4 Draft

document a problem with some older versions of Perl; prevent test case triggering it (and make it more useful)

Comments (0)

Files changed (2)

lib/Sub/NonRole.pm

 can cause a warning to be issued in the global cleanup phase. This is
 unlikely to result in serious problems; it's just annoying.
 
+In older Perls (before 5.10.1 I believe), importing Sub::Role into a package
+without actually applying the attribute to any subs can cause a crash with
+the error message I<< Internal error: Your::Package symbol went missing >>.
+Once you've applied the C<:NonRole> attribute to a sub, everything should be
+OK.
+
 Please report any other bugs to
 L<http://rt.cpan.org/Dist/Display.html?Queue=Sub-NonRole>.
 
 
 use Test::More tests => 1;
 
-package Foo;
-use Moo::Role;
-use Sub::NonRole;
-::pass();
+{
+	package Local::Role;
+	use Moo::Role;
+	use Sub::NonRole;
+	sub zzz :NonRole { 1 };
+}
 
+{
+	package Local::Class;
+	use Moo;
+	with qw< Local::Role >;
+}
+
+my $o = Local::Class->new;
+ok not $o->can('zzz');
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.