New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect method call type within FALLBACK method #5755
Comments
From @dwarringI'm adding a FALLBACK method to create method dynamically, the it receives This then breaks $obj.unknown vs $obj.?unknown handling in class objects. Consider: use Test; class C { for C { I'm receiving both the safe and unsafe 'unknown' invocations, and can't I also tried overriding the classes 'can' method: class C { But the FALLBACK is still needed, and still has the same problem. Any ideas? |
From @dwarringI've worked out how to do it, by adding a custom dispatch:<.?> method: use Test; class C { for C { Based on some code I found in the core Rakudo Mu class. On Tue, Oct 18, 2016 at 1:35 PM, David Warring <perl6-bugs-followup@perl.org
|
From @dwarringUnless I'm mistaken, it takes a bit of extra boiler plate code in a class to add a method in such a way that it plays well with other features, such as the .can introspection method and .? safe invocation. It would be more awesome, if I could do a minimal amount of work, and Rakudo would take care of the details and make sure I'm not breaking anything. Maybe overriding the 'can' method should be enough? On Wed Oct 19 12:17:40 2016, david.warring wrote:
|
Migrated from rt.perl.org#129907 (status was 'new')
Searchable as RT129907$
The text was updated successfully, but these errors were encountered: