Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: c3dff8a67615531b2fb92fe22e696b4f53b41dba
      
https://github.com/Perl/perl5/commit/c3dff8a67615531b2fb92fe22e696b4f53b41dba
  Author: Paul "LeoNerd" Evans <leon...@leonerd.org.uk>
  Date:   2025-03-03 (Mon, 03 Mar 2025)

  Changed paths:
    M op.c
    M t/class/method.t

  Log Message:
  -----------
  op.c: call class_wrap_method_body() for lexical methods

Class method bodies must be wrapped by this function, which adds the
OP_METHSTART op at the beginning, which is responsible for shifting
the `$self` lexical from the arguments array, and setting up field
bindings. This was already done for non-lexical (i.e. package) methods
but was forgotten for lexical methods, so they didn't work properly,
leading to the bug found in GH#23030 whereby the argument count in a
signatured lexical method did not take account of the `$self` argument
properly.

In addition, fields accessed by the method body would not have been
working, though originally this wasn't reported or tested either. A test
for this has also been added.



To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to