projects
/
gitmo/Class-MOP.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
Implement an idea of reducing inline constructors in basic metaclasses
[gitmo/Class-MOP.git]
/
lib
/
Class
/
MOP
/
Attribute.pm
diff --git
a/lib/Class/MOP/Attribute.pm
b/lib/Class/MOP/Attribute.pm
index
3e41652
..
b6b3f52
100644
(file)
--- a/
lib/Class/MOP/Attribute.pm
+++ b/
lib/Class/MOP/Attribute.pm
@@
-57,6
+57,10
@@
sub new {
sub _new {
my $class = shift;
+
+ return Class::MOP::Class->initialize($class)->new_object(@_)
+ if $class ne __PACKAGE__;
+
my $options = @_ == 1 ? $_[0] : {@_};
bless {