Explicitly die if get_all_package_symbols is called as a class method
Dave Rolsky [Mon, 1 Sep 2008 15:05:01 +0000 (15:05 +0000)]
lib/Class/MOP/Package.pm

index 63299f8..a7ba14a 100644 (file)
@@ -276,6 +276,10 @@ sub list_all_package_symbols {
 
 sub get_all_package_symbols {
     my ($self, $type_filter) = @_;
+
+    die "Cannot call get_all_package_symbols as a class method"
+        unless ref $self;
+
     my $namespace = $self->namespace;
 
     return %$namespace unless defined $type_filter;