Skip to content

Conversation

@aryandadwal2006
Copy link
Contributor

Fixes #22259 and thereby allows complex float to complex double promotion without affecting anything else.

@dlang-bot
Copy link
Contributor

dlang-bot commented Dec 25, 2025

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

@aryandadwal2006
Copy link
Contributor Author

@elshorbagyx Hi , please take a look at my PR. I fixed the issue #22259 successfully.

Copy link
Contributor

@thewilsonator thewilsonator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a test case for this.

@aryandadwal2006
Copy link
Contributor Author

Added test case at: compiler/test/compilable/importc_complex_promotion.c

Test validates:
_Complex double x = 1 + 1.0if; // Main issue from #22259
_Complex double y = 2 + 3.0if; // Other mixed precision cases
_Complex double z = 1.0if + 2.0if; // Two float complex values
Existing float complex cases still work
Existing double complex cases still work

The test will fail before the fix and pass after.

@aryandadwal2006
Copy link
Contributor Author

@thewilsonator Could you re-run the FreeBSD CI job?
The code compiled and tests ran, but there was an SSH teardown error.

@aryandadwal2006
Copy link
Contributor Author

The FreeBSD CI job is failing on VM teardown (SSH infrastructure issue),
not on the actual code. The build and tests passed successfully before
the teardown. This is a known CI infrastructure issue on FreeBSD.

All other platforms should pass. Ready for review.

@thewilsonator
Copy link
Contributor

All other platforms should pass.

They don't:

compilable/importc_complex_promotion.c(7): Error: cannot implicitly convert expression `_Complex(0.0F, 1.0F).opBinaryRight(1)` of type `_Complex!float` to `_Complex!double`
    _Complex double x = 1 + 1.0if;

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.

importC: complex fails when passing real and imaginary initializers for non windows systems.

3 participants