Skip to content
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

Adding kind for node[] fields where possible #2058

Closed
eregon opened this issue Dec 13, 2023 · 3 comments · Fixed by #2497
Closed

Adding kind for node[] fields where possible #2058

eregon opened this issue Dec 13, 2023 · 3 comments · Fixed by #2497
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@eregon
Copy link
Member

eregon commented Dec 13, 2023

For at least some of the node[] we could give a kind and so that array's elements would have a proper type in documentation, Java code, etc.
Some example:

  • MatchWriteNode#targets, (I think) always LocalVariableTargetNode

Some counter example:

  • ParametersNode#requireds, not always RequiredParameterNode, can also be MultiTargetNode

In some cases it's not possible because multiple classes are possible, or a MissingNode is possible.

@eregon eregon added the enhancement New feature or request label Dec 13, 2023
@eregon eregon changed the title Adding kind for node[] fields Adding kind for node[] fields where possible Dec 13, 2023
@kddnewton kddnewton added this to the Ruby 3.4.0 milestone Dec 14, 2023
@kddnewton
Copy link
Collaborator

Yes I agree. I think we should also use this opportunity to expand the syntax to support a set of nodes for languages where a union makes sense.

@eregon
Copy link
Member Author

eregon commented Dec 14, 2023

Indeed, a union would be super helpful, even if it only ends up in documentation.
(Java doesn't have union types unfortunately)

@eregon
Copy link
Member Author

eregon commented Jan 9, 2024

Probably we can consider this done when #2101 (comment) is merged.

@kddnewton kddnewton modified the milestones: CRuby unblocked, Long-term Feb 14, 2024
eregon added a commit to eregon/yarp that referenced this issue Feb 25, 2024
eregon added a commit to eregon/yarp that referenced this issue Feb 25, 2024
@eregon eregon self-assigned this Feb 25, 2024
eregon added a commit to eregon/yarp that referenced this issue Feb 28, 2024
matzbot pushed a commit to ruby/ruby that referenced this issue Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants