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 bugzilla issue 24495 - ImportC: Struct initialization expression fails to initialize field #16369

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

ArthaTi
Copy link
Contributor

@ArthaTi ArthaTi commented Apr 10, 2024

Makes it possible to use multiple designated initializers for anonymous structs in expressions like {{ .b = 2, .c = 3 }}. This previously worked only if there was one initializer.

This is my first PR. I had some issues setting up the D runtime and I'm getting linker errors in some tests, but I didn't find any relevant documentation. I built with make/make test.

I have doubts in regards to initializers for anonymous structs/unions in general. I'm not sure if this is the correct way to approach the overall issue, but I will leave it for others to consider.

@dlang-bot
Copy link
Contributor

dlang-bot commented Apr 10, 2024

Thanks for your pull request and interest in making D better, @ArthaTi! 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
24495 major ImportC: Struct initialization expression fails to initialize field

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 + dmd#16369"

@ArthaTi ArthaTi changed the base branch from master to stable April 10, 2024 09:55
@thewilsonator
Copy link
Contributor

thewilsonator commented Apr 10, 2024

Thanks, please retitle the commit Fix bugzilla issue 24495: ImportC: Struct initialization expression fails to initialize field

…fails to initialize field

Makes it possible to use multiple designated initializers for anonymous
structs in expressions like `{{ .b = 2, .c = 3 }}`. This previously
worked only if there was one initializer.
@thewilsonator thewilsonator merged commit 4f69ba5 into dlang:stable Apr 10, 2024
46 of 48 checks passed
@dkorpel
Copy link
Contributor

dkorpel commented Apr 11, 2024

Looks like I hit the exact same bug while using tree-sitter-c:
Issue 24277 - ImportC: struct initializer entry gets ignored (pt2)

Thanks for fixing it! I moved the test in with the other C struct tests in this PR: #16370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants