Skip to content

Commit 922201e

Browse files
authored
Merge pull request #41568 from rintaro/swiftcomplier-fix-diagnoseclosure
[SwiftCompiler] Fix DiagnosticEngine.diagnose()
2 parents ee08dc9 + d62d906 commit 922201e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

SwiftCompilerSources/Sources/AST/DiagnosticEngine.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,17 @@ public struct DiagnosticEngine {
9393
}
9494
}
9595
}
96-
for arg in args {
96+
// 'reversed()' because the closure should be wrapped in that order.
97+
for arg in args.reversed() {
9798
closure = { [closure, arg] in
9899
arg._withBridgedDiagnosticArgument { bridgedArg in
99100
bridgedArgs.append(bridgedArg)
100101
closure()
101102
}
102103
}
103104
}
104-
for fixIt in fixIts {
105+
// 'reversed()' because the closure should be wrapped in that order.
106+
for fixIt in fixIts.reversed() {
105107
closure = { [closure, fixIt] in
106108
fixIt.withBridgedDiagnosticFixIt { bridgedFixIt in
107109
bridgedFixIts.append(bridgedFixIt)

0 commit comments

Comments
 (0)