Skip Menu |

Subject: [BUG] Some Method objects use wrong .gist method
Download (untitled) / with headers
text/plain 1.6k
Method objects have their own `.gist` method[^1] that just print `.name`. However, under some circumstances, that method is lost, and `Mu::gist` is used instead: <Zoffix__> m: <z>.comb.^methods.grep(*.name eq 'eager').say <camelia> rakudo-moar 7af339: OUTPUT: «(Method+{<anon|61058032>}.new)␤» I tried to fix it and failed, but found some facts about the bug that might give a hint: *) The problematic methods has `is nodal` trait on them (which mixes in a role), but NOT all nodal methods have this issue *) (90% sure this is what happened) If you add an only `method z is nodal {}` to src/core/, the bug doesn't appear *) If you add a `multi method z is nodal {}` to src/core/ the bug occurs *) If you do the same thing with a regular class, it doesn't happen. BTW: `Any` is augmented in core *) .file on the method gives src/core/ However, if you modify Mu.gist to append some string, you'll see that it's Mu's method that gets called. <Zoffix__> m: my $m = <z>.comb.^methods.grep(*.name eq 'eager').head; dd $m.^lookup('gist').cando(\($m)).head.file <camelia> rakudo-moar 7af339: OUTPUT: «"SETTING::src/core/"␤» *) Even if you make Method.gist an `only` method, the Mu::gist one is still the one that gets called *) If you implement only or multi method `gist` in the role that `is nodal` mixed in[^2], trying to call .gist on the buggy method gives "Cannot invoke this object (REPR: Null; VMNull)" [1] [2]

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at