Class::MOP::Method and co. are now stricter and require the package_name and name...
[gitmo/Class-MOP.git] / lib / Class / MOP / Method / Generated.pm
index 0b3456a..4042e32 100644 (file)
@@ -15,9 +15,14 @@ sub new {
     my $class   = shift;
     my %options = @_;  
         
+    ($options{package_name} && $options{name})
+        || confess "You must supply the package_name and name parameters";     
+        
     my $self = bless {
         # from our superclass
         '&!body'          => undef,
+        '$!package_name'  => $options{package_name},
+        '$!name'          => $options{name},        
         # specific to this subclass
         '$!is_inline'     => ($options{is_inline} || 0),
     } => $class;