Skip to content

Actually enable -preview=fieldwise by default#20670

Closed
pbackus wants to merge 1 commit intodlang:masterfrom
pbackus:actually-enable-preview-fieldwise
Closed

Actually enable -preview=fieldwise by default#20670
pbackus wants to merge 1 commit intodlang:masterfrom
pbackus:actually-enable-preview-fieldwise

Conversation

@pbackus
Copy link
Copy Markdown
Contributor

@pbackus pbackus commented Jan 9, 2025

This change was accidentally left out of PR #17495.

This change was accidentally left out of PR dlang#17495.
@dlang-bot
Copy link
Copy Markdown
Contributor

Thanks for your pull request and interest in making D better, @pbackus! 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

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

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#20670"

@pbackus
Copy link
Copy Markdown
Contributor Author

pbackus commented Jan 9, 2025

@ryuukk Workaround is to define a BetterC-compatible opEquals for the affected type (in this case, that would be typeof(item)).

@pbackus
Copy link
Copy Markdown
Contributor Author

pbackus commented Jan 9, 2025

Unfortunately this looks like it opens a huge can of worms, so maybe better to delay for now.

@pbackus
Copy link
Copy Markdown
Contributor Author

pbackus commented Jan 9, 2025

The == operator should not behave differently in BetterC than it does in regular D.

pbackus added a commit to pbackus/dmd that referenced this pull request Jan 9, 2025
This reverts commit 6a7bd45.

PR dlang#17495 was originally merged in an incomplete state. Since there are
non-trivial obstacles to completing it, revert the incomplete changes
instead.

See PR dlang#20670 for more information.
@pbackus
Copy link
Copy Markdown
Contributor Author

pbackus commented Jan 9, 2025

Closing in favor of #20672

@pbackus pbackus closed this Jan 9, 2025
@dkorpel
Copy link
Copy Markdown
Contributor

dkorpel commented Jan 9, 2025

@ryuukk Do you have a self-contained test case for that error? Adding that to the test suite would prevent accidentally breaking your project in the future.

@pbackus
Copy link
Copy Markdown
Contributor Author

pbackus commented Jan 9, 2025

@dkorpel The error happens because with -preview=fieldwise, an == test is performed that was originally (erroneously) skipped. That == test (items[i].attributes == item.attributes) was always broken in BetterC, and if the project had ever attempted to perform it directly, it would have triggered the exact same error, with or without this PR.

@dkorpel
Copy link
Copy Markdown
Contributor

dkorpel commented Jan 9, 2025

What are the types of items[i].attributes and item.attributes?

@pbackus
Copy link
Copy Markdown
Contributor Author

pbackus commented Jan 10, 2025

Relevant issue is #18197

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