Hi,

As far as I remember, and can see in PDD15, if you want to modify a class
after it has been instantiated you should clone it and do the
modifications to the clone. Therefore, #46097 and #46093 are resolvable by
removing the comment that dates back to before the decision and changing
the exception message to state that you shouldn't be able to do this
change. I'm about to check that in.

While that is fine, I noticed that add_method and add_vtable_override are
missing this "has the class been instantiated" test. Putting it in,
however, makes some tests fail. Am I right in thinking the tests are wrong
and need to be fixed to clone the (already instantiated) class before
adding the new methods? See for example t/oo/methods.t.

Thanks,

Jonathan


Reply via email to