Skip to content

Downgrade diagnostic for uses of noasync declarations in async contexts in macro arguments #80835

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

Closed
hamishknight opened this issue Apr 15, 2025 · 0 comments · Fixed by #80853
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself swift macro Feature → declarations: Swift `macro` declarations type checker Area → compiler: Semantic analysis

Comments

@hamishknight
Copy link
Contributor

#80583 broke source compatibility for uses of noasync declarations in closure macro arguments passed to macros that have async function parameters:

@available(*, noasync)
func foo() {}

@freestanding(expression)
macro M(_ fn: () async -> Void) = #externalMacro(module: "", type: "")

#M {
  foo() // Legal in Swift 6, became an error under Swift 6 mode
}

We ought to downgrade the diagnostic to a warning for macro arguments until we get a new language mode.

@hamishknight hamishknight added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself swift macro Feature → declarations: Swift `macro` declarations type checker Area → compiler: Semantic analysis labels Apr 15, 2025
@hamishknight hamishknight self-assigned this Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself swift macro Feature → declarations: Swift `macro` declarations type checker Area → compiler: Semantic analysis
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant