Skip to content

Fix #18531 - Disallow (dis)equality with FP.nan/FP.init literals#23268

Open
0-v-0 wants to merge 3 commits into
dlang:masterfrom
0-v-0:issue18531
Open

Fix #18531 - Disallow (dis)equality with FP.nan/FP.init literals#23268
0-v-0 wants to merge 3 commits into
dlang:masterfrom
0-v-0:issue18531

Conversation

@0-v-0

@0-v-0 0-v-0 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@dlang-bot

Copy link
Copy Markdown

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

⚠️⚠️⚠️ Warnings ⚠️⚠️⚠️

  • In preparation for migrating from Bugzilla to GitHub Issues, the issue reference syntax has changed. Please add the word "Bugzilla" to issue references. For example, Fix Bugzilla Issue 12345 or Fix Bugzilla 12345.(Reminder: the edit needs to be done in the Git commit message, not the GitHub pull request.)

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

@adamdruppe

adamdruppe commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

does still allow v is float.nan?

edit: lol i see it in the error message but the test should confirm it has no error anyway

@Herringway

Copy link
Copy Markdown
Contributor

Shouldn't the error mention the actual constants instead of what appears to be internal names like nanF?

@xoxorwr

xoxorwr commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Suggesting a Phobos dependency in a compiler error is undesirable imo.
It should probably live in core package.

@dkorpel

dkorpel commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Shouldn't the error mention the actual constants instead of what appears to be internal names like nanF?

This PR uses the correct toErrMsg, it looks like a separate issue: #23270

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.

6 participants