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

Add support for noinit remote variables. #27074

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

DanilaFe
Copy link
Contributor

@DanilaFe DanilaFe commented Apr 8, 2025

Closes #27068.

This PR adds support for noinit remote variables. There was previously no support for them, though I hadn't considered that case and as a consequence hadn't documented them. To support them, a degree of special-casing is required (an x = noinit expression is specially treated, and we rewrite initialization expressions for remote variables).

On the technical side, this PR adds a new overload to the remote variable builder. This overload is distinguished from others by a dummy type formal which is expected always to be void (inspired by the type of the noinit global variable). This overload simply constructs a remote variable wrapper with a noinit'ed temporary.

While there, I noticed that an assertion was incorrectly flipped in the body of the code. This assertion was for a case ruled out by post-parse checks; in developer builds, it ought to always fire. However, I suspect it didn't cause any problems because assertions are disabled in release mode. I flipped the assertion to its correct value.

DanilaFe added 8 commits April 8, 2025 10:53
Signed-off-by: Danila Fedorin <[email protected]>
Signed-off-by: Danila Fedorin <[email protected]>
Somehow, that's not equivalent to the default one.

Signed-off-by: Danila Fedorin <[email protected]>
Signed-off-by: Danila Fedorin <[email protected]>
@lydia-duncan lydia-duncan self-requested a review April 10, 2025 20:08
Copy link
Member

@lydia-duncan lydia-duncan left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for jumping on this!

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.

Compile-time error and wrong message when declaring a non-initialized remote variable
2 participants