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
197
197
return std::nullopt;
198
198
}
199
199
200
- // Allocate variable with a placeholder type
201
- auto *resultVar = buildPlaceholderVar (stmt->getStartLoc (), newBody);
202
-
203
200
if (ctx.CompletionCallback && stmt->getSourceRange ().isValid () &&
204
201
!containsIDEInspectionTarget (stmt->getSourceRange (), ctx.SourceMgr ) &&
205
202
!isa<GuardStmt>(stmt)) {
@@ -209,6 +206,9 @@ class ResultBuilderTransform
209
206
return std::nullopt;
210
207
}
211
208
209
+ // Allocate variable with a placeholder type
210
+ auto *resultVar = buildPlaceholderVar (stmt->getStartLoc (), newBody);
211
+
212
212
auto result = visit (stmt, resultVar);
213
213
if (!result)
214
214
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