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

[foreach] Deprecate ref for array index or ForeachRangeStatement #16381

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

ntrel
Copy link
Contributor

@ntrel ntrel commented Apr 14, 2024

Fix Bugzilla 24499 - foreach over a ref parameter to an rvalue should be an error
Fix Bugzilla 24232 - ref for index of foreach for arrays is not allowed by spec but accepted by compiler

@dlang-bot
Copy link
Contributor

dlang-bot commented Apr 14, 2024

Thanks for your pull request and interest in making D better, @ntrel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
24232 normal ref for index of foreach for arrays is not allowed by spec but accepted by compiler.
24499 normal foreach over a ref parameter to an rvalue should be an error

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#16381"

ntrel added a commit to ntrel/phobos that referenced this pull request Apr 14, 2024
@ntrel
Copy link
Contributor Author

ntrel commented Apr 14, 2024

Fix Bugzilla 24232

For some reason that didn't get picked up by dlang-bot.

Edit: added a separate commit saying that, now it got picked up. Does it not find multiple issues?

ntrel added a commit to ntrel/phobos that referenced this pull request Apr 14, 2024
@ntrel ntrel force-pushed the ref-index branch 2 times, most recently from 6f48624 to 7bfff75 Compare April 15, 2024 09:35
Fix Bugzilla 24499 - foreach over a ref parameter to an rvalue should be an error

Fix Bugzilla 24232 - ref for index of foreach for arrays is not allowed by spec but accepted by compiler
@dkorpel
Copy link
Contributor

dkorpel commented Apr 16, 2024

Does it not find multiple issues?

I think it does when you list them like "Fix Bugzilla 24499, 24232"

@ntrel ntrel changed the title [foreach] Deprecate ref for array index or range parameter [foreach] Deprecate ref for array index or ForeachRangeStatement Apr 16, 2024
ntrel added a commit to ntrel/phobos that referenced this pull request Apr 17, 2024
dlang-bot pushed a commit to dlang/phobos that referenced this pull request Apr 17, 2024
ntrel added a commit to ntrel/undeaD that referenced this pull request Apr 17, 2024
thewilsonator pushed a commit to dlang/undeaD that referenced this pull request Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants