Skip to content

Replace Identifiers* names with ArgumentLabels* names across the frontend #21297

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

Merged
merged 1 commit into from
Apr 30, 2025

Conversation

Ay1nDas
Copy link
Contributor

@Ay1nDas Ay1nDas commented Apr 23, 2025

This PR is a continuation of PR #21262. Check it out for more details.

#Summary

This PR replaces all uses of the Identifiers* names field in expression-related functions (callExp, newExp, etc.) with a more expressive and structured alternative: ArgumentLabels* argLabels.

  • Replaced all names fields (of type Identifiers*) with argLabels (of type ArgumentLabels* = Array!(ArgumentLabel)).
  • Code using argLabels is backwards-compatible where necessary by providing Identifiers* via helper conversion.

@Ay1nDas Ay1nDas marked this pull request as ready for review April 24, 2025 05:30
@Ay1nDas Ay1nDas requested a review from ibuclaw as a code owner April 24, 2025 05:30
@ibuclaw
Copy link
Member

ibuclaw commented Apr 24, 2025

This shouldn't be targeting stable unless it's a bug fix. Thanks.

@Ay1nDas
Copy link
Contributor Author

Ay1nDas commented Apr 24, 2025

Apologies for the confusion caused. I forgot to mention this is a continuation of PR #21262, in that PR I added a new struct ArgLabel in dmd/expression.d and implemented it in some places to fix issue #21215.
This PR is to replace Identifiers* names with ArgumentLabels* argLabels (defined here) so that we don't have to maintain 3 different arrays for expressions (arguments, argLabels, names).

Now to answer the questions:

I hope this clarifies everything. I split the changes into 2 PRs as I thought it would be confusing and people might think... why all the names are being replaced with argLabels to fix a bug?

Copy link
Contributor

@dkorpel dkorpel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR's diff does 2 things:

  • rename names to argLabels
  • fix the bug where argLabels don't get expanded with tuples

Mixing refactoring and bug fixes in a single pull requests should generally be avoided, because when a regression happens and a bissection points to this PR, it is still hard to see what's going on because actual code changes are mixed with many lines that simply rename something. Can you simplify this PR by applying the code changes to the original names variable?

@Ay1nDas Ay1nDas force-pushed the rm-names branch 2 times, most recently from a964f5d to 1544118 Compare April 29, 2025 18:40
@Ay1nDas Ay1nDas changed the title Replace names (Identifiers*) with argLabels (ArgumentLabels*) across the frontend Replace Identifiers* names with ArgumentLabels* names across the frontend Apr 29, 2025
@Ay1nDas Ay1nDas requested a review from dkorpel April 29, 2025 18:47
@Ay1nDas Ay1nDas force-pushed the rm-names branch 2 times, most recently from 7a1d315 to e985ea1 Compare April 29, 2025 19:16
@dkorpel dkorpel merged commit bed2a5c into dlang:stable Apr 30, 2025
58 of 73 checks passed
Ay1nDas added a commit to Ay1nDas/dmd that referenced this pull request Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants