mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #85807 from allevato/more-json-ast-fixes-2
[ASTDumper] Fix malformed JSON for `async let _ = ...`.
This commit is contained in:
@@ -1913,10 +1913,8 @@ namespace {
|
||||
printFoot();
|
||||
}
|
||||
void visitAnyPattern(AnyPattern *P, Label label) {
|
||||
if (P->isAsyncLet()) {
|
||||
printCommon(P, "async_let ", label);
|
||||
}
|
||||
printCommon(P, "pattern_any", label);
|
||||
printFlag(P->isAsyncLet(), "async_let", DeclModifierColor);
|
||||
printFoot();
|
||||
}
|
||||
void visitTypedPattern(TypedPattern *P, Label label) {
|
||||
|
||||
@@ -503,3 +503,11 @@ func outerFn() {
|
||||
}
|
||||
innerFun(shouldRecurse: true)
|
||||
}
|
||||
|
||||
// Regression test: Discarded async lets were calling `printCommon` twice,
|
||||
// which resulted in invalid JSON (and not-so-great S-expression output)
|
||||
// either.
|
||||
func discardedAsyncLet() async {
|
||||
func someTask() async {}
|
||||
async let _ = someTask()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user