Skip to content

Comparison docs have wrong wording #4222

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

Open
ntrel opened this issue Apr 11, 2025 · 0 comments · May be fixed by #4223
Open

Comparison docs have wrong wording #4222

ntrel opened this issue Apr 11, 2025 · 0 comments · May be fixed by #4223

Comments

@ntrel
Copy link
Contributor

ntrel commented Apr 11, 2025

https://dlang.org/spec/operatoroverloading.html#eqcmp

opCmp is only used for the inequality operators <, <=, >=, and >.

  1. The spec should use RelExpression instead of 'inequality operators', as inequality means !=.
  2. The compiler only generates opEquals for structs, not classes.

PR incoming.

ntrel added a commit to ntrel/dlang.org that referenced this issue Apr 11, 2025
Fixes dlang#4222.

Use RelExpression instead of 'inequality operators', as inequality is
used to mean `!=`.
Clarify that the compiler only generates a default `opEquals` for structs.
ntrel added a commit to ntrel/dlang.org that referenced this issue Apr 11, 2025
Fixes dlang#4222.

Use RelExpression instead of 'inequality operators', as inequality is
used to mean `!=`.
Clarify that the compiler only generates a default `opEquals` for structs.
@ntrel ntrel linked a pull request Apr 11, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant