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 @@ -1006,6 +1006,9 @@ Optional<BraceStmt *> TypeChecker::applyResultBuilderBodyTransform(
1006
1006
// Solve the constraint system.
1007
1007
if (cs.getASTContext ().CompletionCallback ) {
1008
1008
SmallVector<Solution, 4 > solutions;
1009
+ cs.Options |= ConstraintSystemFlags::AllowFixes;
1010
+ cs.Options |= ConstraintSystemFlags::SuppressDiagnostics;
1011
+ cs.Options |= ConstraintSystemFlags::ForCodeCompletion;
1009
1012
cs.solveForCodeCompletion (solutions);
1010
1013
1011
1014
CompletionContextFinder analyzer (func, func->getDeclContext ());
Original file line number Diff line number Diff line change @@ -1511,7 +1511,7 @@ struct AmbiguousCallInResultBuilder {
1511
1511
func ttroke( _ content: Int , lineWidth: Int = 1 ) -> Int { 42 }
1512
1512
1513
1513
@MyResultBuilder var body : Int {
1514
- self . ttroke ( 1 , #^AMBIGUOUS_IN_RESULT_BUILDER? xfail = TODO ^#)
1514
+ self . ttroke ( 1 , #^AMBIGUOUS_IN_RESULT_BUILDER^#)
1515
1515
// AMBIGUOUS_IN_RESULT_BUILDER: Begin completions, 2 items
1516
1516
// AMBIGUOUS_IN_RESULT_BUILDER-DAG: Pattern/Local/Flair[ArgLabels]: {#style: String#}[#String#];
1517
1517
// AMBIGUOUS_IN_RESULT_BUILDER-DAG: Pattern/Local/Flair[ArgLabels]: {#lineWidth: Int#}[#Int#];
Original file line number Diff line number Diff line change @@ -388,3 +388,24 @@ func testCompleteIfLetInResultBuilder() {
388
388
// IF_LET_IN_RESULT_BUILDER: End completions
389
389
}
390
390
}
391
+
392
+ func testOverloadedCallArgs( ) {
393
+ func overloaded( single: Int ) -> Int { }
394
+ func overloaded( _ first: Int , second: Int ) -> Int { }
395
+
396
+ @resultBuilder struct ViewBuilder {
397
+ static func buildBlock( _ content: Int ) -> Int { content }
398
+ }
399
+
400
+ struct Test {
401
+ @ViewBuilder var body : Int {
402
+ overloaded ( #^OVERLOADED_CALL_ARG^#, second: 1 )
403
+ // OVERLOADED_CALL_ARG: Begin completions
404
+ // OVERLOADED_CALL_ARG-DAG: Decl[FreeFunction]/Local/Flair[ArgLabels]/TypeRelation[Convertible]: ['(']{#single: Int#}[')'][#Int#];
405
+ // OVERLOADED_CALL_ARG-DAG: Decl[FreeFunction]/Local/Flair[ArgLabels]/TypeRelation[Convertible]: ['(']{#(first): Int#}, {#second: Int#}[')'][#Int#];
406
+ // OVERLOADED_CALL_ARG-DAG: Literal[Integer]/None/TypeRelation[Convertible]: 0[#Int#];
407
+ // OVERLOADED_CALL_ARG: End completions
408
+ }
409
+ }
410
+
411
+ }
You can’t perform that action at this time.
0 commit comments