niner / Inline-Perl5

Use Perl 5 code in a Raku program
Artistic License 2.0
95 stars 27 forks source link

Fix access to $=finish via CALLER pseudo #168

Closed vrurg closed 3 years ago

vrurg commented 3 years ago

CALLER is actually a dynamic chain only pseudo-package. The only reason CALLER::<$=finish> worked previously is due to a bug in underlying PseudoStash. Correct access must be done via CALLER::MY::<$=finish>.

It is also not necessary to workaround a bug in Rakudo by manually instantiating a PseudoStash instance. The above used CALLER::MY:: syntax sugar works now.

vrurg commented 3 years ago

I'm working on a fix for PseudoStash classes where they were silently considering any symbol which is not a Scalar as dynamic. So, soon CALLER::<$=finish> will be throwing. Correct way is CALLER::MY::<$=finish>.

Also, I don't know what kind of bug required use of manual instantiation of PseudoStash, but it is not needed anymore.

This PR passes all tests.