File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
validation-test/IDE/issues_fixed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -197,9 +197,6 @@ class ResultBuilderTransform
197197 return std::nullopt ;
198198 }
199199
200- // Allocate variable with a placeholder type
201- auto *resultVar = buildPlaceholderVar (stmt->getStartLoc (), newBody);
202-
203200 if (ctx.CompletionCallback && stmt->getSourceRange ().isValid () &&
204201 !containsIDEInspectionTarget (stmt->getSourceRange (), ctx.SourceMgr ) &&
205202 !isa<GuardStmt>(stmt)) {
@@ -209,6 +206,9 @@ class ResultBuilderTransform
209206 return std::nullopt ;
210207 }
211208
209+ // Allocate variable with a placeholder type
210+ auto *resultVar = buildPlaceholderVar (stmt->getStartLoc (), newBody);
211+
212212 auto result = visit (stmt, resultVar);
213213 if (!result)
214214 return UnsupportedElt (stmt);
Original file line number Diff line number Diff line change 1+ // RUN: %batch-code-completion
2+
3+ @resultBuilder struct MyBuilder {
4+ static func buildBlock( _ components: [ Int ] ... ) -> [ Int ]
5+ static func buildFinalResult( _ component: [ Int ] ) -> Int
6+ }
7+
8+ func build( @MyBuilder itemsBuilder: ( ) -> Int ) { }
9+
10+ func test( ) {
11+ let modifiers = build {
12+ for modifier in invalid {
13+ }
14+ }
15+
16+ modifiers. #^COMPLETE^#
17+ }
18+
19+ // COMPLETE: Keyword[self]/CurrNominal: self[#Void#]; name=self
You can’t perform that action at this time.
0 commit comments