Skip to content

Commit

Permalink
Make .? spesh plugin bug compatible with .
Browse files Browse the repository at this point in the history
The spesh plugin for `.?` fixed a long-standing issue with method
augmented into parent classes not being visible to subclasses. While
that's in theory good, in practice there was code in the wild that
used `.?` in a filtering step and then `.` to call, and inconsistent
behavior between the two (`.?` being fixed and `.` not yet) caused
breakage. This is discussed in issue #1923. Therefore, re-introduce
the bug to `.?`, until we can fix `.` too.
  • Loading branch information
jnthn committed Jun 20, 2018
1 parent 304239d commit a167e6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vm/moar/spesh-plugins.nqp
Expand Up @@ -38,7 +38,7 @@ nqp::speshreg('perl6', 'qualmeth', -> $obj, str $name, $type {
sub discard-and-nil(*@pos, *%named) { Nil }
nqp::speshreg('perl6', 'maybemeth', -> $obj, str $name {
nqp::speshguardtype($obj, $obj.WHAT);
my $meth := $obj.HOW.find_method($obj, $name);
my $meth := nqp::tryfindmethod($obj, $name);
nqp::isconcrete($meth)
?? $meth
!! &discard-and-nil
Expand Down

0 comments on commit a167e6c

Please sign in to comment.