Subject: | Method::Lexical no longer works correctly on perl 5.21.7 |
Since perl 5.21.7 there are 3 more method ops:
1) OP_METHOD_SUPER for ->SUPER::method() calls
2) OP_METHOD_REDIR for ->OtherClass::method() calls
3) OP_METHOD_REDIR_SUPER for ->OtherClass::SUPER::method() calls
Now the only case for OP_METHOD is really dynamic method name call
->$method_name
This was done to significantly increase method call perfomance.
Please make changes to your module to meet new changes.
Something like
#if PERL_VERSION >= 5.21.7
else if (o->op_type == OP_METHOD_SUPER) {
...
}
else if (....
Keep in mind additional changes:
1) All method ops are now not UNOP or SVOP. They are now all METHOP (although METHOP is binary compatible with them both)
2) when OP_METHOD_SUPER, op_sv (meth_sv) contains only method name without "SUPER::"
3) when OP_METHOD_REDIR, op_sv(meth_sv) contains only method name without "OtherClass::", class name is in cMETHOPx_rclass(op)
4) when OP_METHOD_REDIR_SUPER, op_sv(meth_sv) contains only method name without "OtherClass::SUPER::", class name is in cMETHOPx_rclass(op) (without "SUPER::")
P.S.
when i was looking at the Lexical.xs code i wondered why did you make things so complicated? why did you copy-paste contents of S_method_common, gv_fetchmeth_pvn and even mro_get_linear_isa ?
You could at least use gv_fetchmeth_pvn call. Because things change and speed up in perl's core. When you hardcode it, they are not speeded up... And may break :(