stevan / p5-mop-redux

A(nother) MOP for Perl 5
139 stars 36 forks source link

need to check method_class and attribute_class for metaclass compat #136

Open doy opened 11 years ago

doy commented 11 years ago

If a class sets method_class to a certain value, it should then be able to assume that all methods defined in a class whose metaclass inherits from it also inherit from the thing method_class was set to. Currently though, a subclass can override method_class to some completely unrelated class, breaking this (and the same goes for attributes). We just need to check method_class and attribute_class during metaclass creation to make sure they are compatible - I don't think there's really any fixing we can do here (is there?).