File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
test/refactoring/ConvertAsync Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -4536,7 +4536,8 @@ struct CallbackCondition {
4536
4536
4537
4537
// / A bool condition expression.
4538
4538
explicit CallbackCondition (const Expr *E) {
4539
- if (!E->getType ()->isBool ())
4539
+ // FIXME: Sema should produce ErrorType.
4540
+ if (!E->getType () || !E->getType ()->isBool ())
4540
4541
return ;
4541
4542
4542
4543
auto CondType = ConditionType::IS_TRUE;
Original file line number Diff line number Diff line change
1
+ func callbackIntWithError( _ completion: ( Int8 , Error ? ) -> Void ) { }
2
+
3
+ // rdar://79864182
4
+ // RUN: %refactor -convert-call-to-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=INVALID-COND %s
5
+ callbackIntWithError { x, err in
6
+ if x {
7
+ print ( " ok " )
8
+ }
9
+ }
10
+ // INVALID-COND: let x = try await callbackIntWithError()
11
+ // INVALID-COND-NEXT: if x {
12
+ // INVALID-COND-NEXT: print("ok")
13
+ // INVALID-COND-NEXT: }
14
+
You can’t perform that action at this time.
0 commit comments