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

Fix issue 23400 - Can't format enum value whose base type has non-con… #8591

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

pbackus
Copy link
Contributor

@pbackus pbackus commented Oct 9, 2022

…st opEquals


Regression introduced by #8249.

@pbackus
Copy link
Contributor Author

pbackus commented Oct 9, 2022

Failure is unrelated. For some reason, CirrusCI is unable to download DMD on FreeBSD 11.

@nordlow
Copy link
Contributor

nordlow commented Oct 9, 2022

I'm not convinced we should allow non-const non-pure non-scope toString(). What do you think, @RazvanN7?

@pbackus
Copy link
Contributor Author

pbackus commented Oct 9, 2022

@nordlow This bug has nothing to do with toString; it is about opEquals.

@pbackus
Copy link
Contributor Author

pbackus commented Oct 9, 2022

Also, given that Obect.toString is non-const, non-pure, and non-scope, I think it's unlikely we'll be able to drop such support any time soon.

@pbackus
Copy link
Contributor Author

pbackus commented Oct 12, 2022

Re: template bloat, it would be possible to reduce it in the common case by adding an overload specifically for enums with primitive base types (integers, characters, pointers) which takes its argument as const, since == on primitive types works the same regardless of qualifier.

@dlang-bot
Copy link
Contributor

dlang-bot commented Oct 16, 2022

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

Auto-close Bugzilla Severity Description
23400 regression [REG 2.099] Can't format enum value whose base type has non-const opEquals

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 "stable + phobos#8591"

@pbackus
Copy link
Contributor Author

pbackus commented Oct 16, 2022

Rebased to pick up #8602

@thewilsonator
Copy link
Contributor

stable?

@pbackus
Copy link
Contributor Author

pbackus commented Oct 16, 2022

I guess it should be stable now, since we missed the master -> stable merge. Will rebase.

@pbackus pbackus changed the base branch from master to stable October 16, 2022 21:46
@RazvanN7 RazvanN7 merged commit 02de39a into dlang:stable Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants