[AST] ASTPrinter: Always print nonisolated(nonsending) parameter specifier first

This avoids any possible positioning issues between specifiers
and attributes.

(cherry picked from commit 6662a48533)
This commit is contained in:
Pavel Yaskevich
2025-04-15 14:53:57 -07:00
parent 0af7032d91
commit 9cf984a1b1
2 changed files with 32 additions and 4 deletions

View File

@@ -5,6 +5,13 @@
// REQUIRES: concurrency
public struct TestWithAttrs {
// CHECK: #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes
// CHECK-NEXT: public func test(_: nonisolated(nonsending) @escaping () async -> Swift.Void)
// CHECK-NEXT: #endif
public func test(_: nonisolated(nonsending) @escaping () async -> Void) {}
}
public struct Test {
// CHECK: #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes
// CHECK-NEXT: nonisolated(nonsending) public init() async