Skip to content

Allow inout parameters in expression macros #82370

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

natecook1000
Copy link
Member

Sema seems to be flagging inout expressions (e.g. &foo) in expression macros as invalid, setting up a catch 22 where Sema emits an error when a parameter has the '&' sigil and type checking fails when it doesn't.

This resolves the issue by allowing inout expressions inside macro expansion expressions.

Resolves #82369.

@natecook1000
Copy link
Member Author

@swift-ci Please smoke test

@natecook1000
Copy link
Member Author

@swift-ci Please smoke test macOS platform

@natecook1000
Copy link
Member Author

@swift-ci Please smoke test Linux platform

1 similar comment
@natecook1000
Copy link
Member Author

@swift-ci Please smoke test Linux platform

Sema seems to be flagging inout expressions (e.g. &foo) in expression
macros as invalid, setting up a catch 22 where Sema emits an error
when a parameter has the '&' sigil and type checking fails when it
doesn't.

This resolves the issue by allowing inout expressions inside macro
expansion expressions.
@natecook1000 natecook1000 force-pushed the macro-expression-inout branch from 14141ca to c6e35fa Compare June 20, 2025 18:08
@natecook1000 natecook1000 marked this pull request as ready for review June 20, 2025 18:09
@natecook1000
Copy link
Member Author

@swift-ci Please smoke test

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.

Macro expressions can't be used with inout parameters
1 participant