File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -1008,6 +1008,9 @@ llvm::Optional<BraceStmt *> TypeChecker::applyResultBuilderBodyTransform(
1008
1008
// Solve the constraint system.
1009
1009
if (cs.getASTContext ().CompletionCallback ) {
1010
1010
SmallVector<Solution, 4 > solutions;
1011
+ cs.Options |= ConstraintSystemFlags::AllowFixes;
1012
+ cs.Options |= ConstraintSystemFlags::SuppressDiagnostics;
1013
+ cs.Options |= ConstraintSystemFlags::ForCodeCompletion;
1011
1014
cs.solveForCodeCompletion (solutions);
1012
1015
1013
1016
SyntacticElementTarget funcTarget (func);
Original file line number Diff line number Diff line change @@ -1383,7 +1383,7 @@ struct AmbiguousCallInResultBuilder {
1383
1383
func ttroke( _ content: Int , lineWidth: Int = 1 ) -> Int { 42 }
1384
1384
1385
1385
@MyResultBuilder var body : Int {
1386
- self . ttroke ( 1 , #^AMBIGUOUS_IN_RESULT_BUILDER? xfail = TODO ^#)
1386
+ self . ttroke ( 1 , #^AMBIGUOUS_IN_RESULT_BUILDER^#)
1387
1387
// AMBIGUOUS_IN_RESULT_BUILDER: Begin completions, 2 items
1388
1388
// AMBIGUOUS_IN_RESULT_BUILDER-DAG: Pattern/Local/Flair[ArgLabels]: {#style: String#}[#String#];
1389
1389
// AMBIGUOUS_IN_RESULT_BUILDER-DAG: Pattern/Local/Flair[ArgLabels]: {#lineWidth: Int#}[#Int#];
Original file line number Diff line number Diff line change @@ -360,3 +360,24 @@ func testCompleteIfLetInResultBuilder() {
360
360
// IF_LET_IN_RESULT_BUILDER: End completions
361
361
}
362
362
}
363
+
364
+ func testOverloadedCallArgs( ) {
365
+ func overloaded( single: Int ) -> Int { }
366
+ func overloaded( _ first: Int , second: Int ) -> Int { }
367
+
368
+ @resultBuilder struct ViewBuilder {
369
+ static func buildBlock( _ content: Int ) -> Int { content }
370
+ }
371
+
372
+ struct Test {
373
+ @ViewBuilder var body : Int {
374
+ overloaded ( #^OVERLOADED_CALL_ARG^#, second: 1 )
375
+ // OVERLOADED_CALL_ARG: Begin completions
376
+ // OVERLOADED_CALL_ARG-DAG: Decl[FreeFunction]/Local/Flair[ArgLabels]/TypeRelation[Convertible]: ['(']{#single: Int#}[')'][#Int#];
377
+ // OVERLOADED_CALL_ARG-DAG: Decl[FreeFunction]/Local/Flair[ArgLabels]/TypeRelation[Convertible]: ['(']{#(first): Int#}, {#second: Int#}[')'][#Int#];
378
+ // OVERLOADED_CALL_ARG-DAG: Literal[Integer]/None/TypeRelation[Convertible]: 0[#Int#];
379
+ // OVERLOADED_CALL_ARG: End completions
380
+ }
381
+ }
382
+
383
+ }
You can’t perform that action at this time.
0 commit comments