Skip to content

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

@hamishknight

Description

@hamishknight

#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.

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfswift macroFeature → declarations: Swift `macro` declarationstype checkerArea → compiler: Semantic analysis

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions