-
Notifications
You must be signed in to change notification settings - Fork 452
Support methods without names in interfaces #2169
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR! This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged. |
// Keeping EventListener and EventListenerObject isn't the most elegant way to handle the event listeners, but we need to keep the EventListener as an extendable interface for libraries like angular. | ||
interface EventListener noInterfaceObject=#true { | ||
method callable { | ||
type void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good reason to use returns=void
@@ -0,0 +1,7 @@ | |||
// Keeping EventListener and EventListenerObject isn't the most elegant way to handle the event listeners, but we need to keep the EventListener as an extendable interface for libraries like angular. | |||
interface EventListener noInterfaceObject=#true { | |||
method callable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have interface.anonymouseMethods
so use it with something like anonymous-method {}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will update it
I have updated @saschanaz |
Ohno, I forgot that it was only for getters and stringifiers... sorry 🫠 But maybe |
No issues @saschanaz |
]; | ||
return { name, signature }; | ||
return { | ||
...optionalMember("name", "string", name), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should this be optionalMember?
#2053
This PR adds support for methods without explicit names.
I got the name "callable", from the jsonc