-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Are metaclass methods tested? #4497
Comments
They should be tested. They work by creating an anonymous role containing such methods, and mixing it into the metaclass instance for the class. |
I have a tab with Raku/roast#553 opened for two years already. But there is always something with higher priority... |
I'm glad someone else uses their browser tabs as a TODO list 😃 |
I'm trying to figure out what'd be necessary to spec about metamethods? Aside of the evident: class Foo { method ^foo(\obj) { ... } }
Foo.^foo; We could spec for:
And that's basically it. I wouldn't even spec the implementation detail of a role being mixed into One behavior is certainly the candidate for Roast: class C1 { method foo(\obj) { say "meta" } }
class C2 is C1 { }
C2.^foo; # meta Not sure if many people know about this. |
We never tested for class Foo { method ^foo($) {...} } Resolves rakudo/rakudo#4497 and Raku#553
The Problem
Metaclass methods (
method ^foo
) were introduced in 2015.03. They don't seem to have been tested either in Rakudo or in roast.Expected Behavior
That's the problem, not clear what's the expected behavior. "Metaclass" methods seem pretty descriptive, but it's not clear if this adds a method to the actual metaclass, or simply adds a method that can be accessed via the HOW. I imagine it's the latter, but still, a test would really help create a use case for Raku/doc#2856
The text was updated successfully, but these errors were encountered: