File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,10 @@ void PostfixCompletionCallback::sawSolutionImpl(
156
156
auto *ParsedExpr = CompletionExpr->getBase ();
157
157
auto *SemanticExpr = ParsedExpr->getSemanticsProvidingExpr ();
158
158
159
+ if (!S.hasType (ParsedExpr)) {
160
+ return ;
161
+ }
162
+
159
163
auto BaseTy = getTypeForCompletion (S, ParsedExpr);
160
164
// If base type couldn't be determined (e.g. because base expression
161
165
// is an invalid reference), let's not attempt to do a lookup since
Original file line number Diff line number Diff line change @@ -225,3 +225,13 @@ func testCompleteAfterPatternInClosure() {
225
225
226
226
// AFTER_PATTERN_IN_CLOSURE-NOT: Begin completions
227
227
}
228
+
229
+ func testIfLetInClosure( foo: Int ? ) {
230
+ func takeClosure( _ x: ( ) -> Void ) { }
231
+
232
+ takeClosure {
233
+ if let items#^IF_LET_IN_CLOSURE^# = foo {
234
+ }
235
+ }
236
+ // IF_LET_IN_CLOSURE-NOT: Begin completions
237
+ }
You can’t perform that action at this time.
0 commit comments