File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -2785,7 +2785,7 @@ class ConstraintSystem {
2785
2785
void
2786
2786
filterSolutions (SmallVectorImpl<Solution> &solutions,
2787
2787
bool minimize = false ) {
2788
- if (solutions.size () < 2 )
2788
+ if (solutions.size () < 2 || isForCodeCompletion () )
2789
2789
return ;
2790
2790
2791
2791
if (auto best = findBestSolution (solutions, minimize)) {
Original file line number Diff line number Diff line change 46
46
// RUN: %swift-ide-test -code-completion -source-filename %s -code-completion-token=MULTICLOSURE_FUNCBUILDER_ERROR | %FileCheck %s --check-prefix=POINT_MEMBER
47
47
// RUN: %swift-ide-test -code-completion -source-filename %s -code-completion-token=MULTICLOSURE_FUNCBUILDER_FIXME | %FileCheck %s --check-prefix=NORESULTS
48
48
// RUN: %swift-ide-test -code-completion -source-filename %s -code-completion-token=REGULAR_MULTICLOSURE_APPLIED | %FileCheck %s --check-prefix=POINT_MEMBER
49
+ // RUN: %swift-ide-test -code-completion -source-filename %s -code-completion-token=BEST_SOLUTION_FILTER | %FileCheck %s --check-prefix=BEST_SOLUTION_FILTER
50
+ // RUN: %swift-ide-test -code-completion -source-filename %s -code-completion-token=BEST_SOLUTION_FILTER2 | %FileCheck %s --check-prefix=BEST_SOLUTION_FILTER
49
51
50
52
51
53
struct A {
@@ -438,3 +440,23 @@ takesClosureOfPoint { p in
438
440
if p. #^REGULAR_MULTICLOSURE_APPLIED^# { }
439
441
}
440
442
}
443
+
444
+ enum Enum123 {
445
+ case enumElem
446
+ }
447
+ struct Struct123 : Equatable {
448
+ var structMem = Enum123 . enumElem
449
+ }
450
+ func testNoBestSolutionFilter( ) {
451
+ let a = Struct123 ( ) ;
452
+ let b = [ Struct123] ( ) . first ( where: { $0 == a && 1 + 90 * 5 / 8 == 45 * - 10 } ) ? . structMem != . #^BEST_SOLUTION_FILTER^#
453
+ let c = min ( 10.3 , 10 / 10.4 ) < 6 + 5 / ( 10 - 3 ) ? true : Optional ( a) ? . structMem != . #^BEST_SOLUTION_FILTER2 ^#
454
+ }
455
+
456
+ // BEST_SOLUTION_FILTER: Begin completions
457
+ // BEST_SOLUTION_FILTER-DAG: Decl[EnumElement]/ExprSpecific/TypeRelation[Convertible]: enumElem[#Enum123#]{{; name=.+$}}
458
+ // BEST_SOLUTION_FILTER-DAG: Decl[InstanceMethod]/CurrNominal/TypeRelation[Invalid]: hash({#(self): Enum123#})[#(into: inout Hasher) -> Void#]{{; name=.+$}}
459
+ // BEST_SOLUTION_FILTER-DAG: Keyword[nil]/None/Erase[1]/TypeRelation[Identical]: nil[#Enum123?#]{{; name=.+$}}
460
+ // BEST_SOLUTION_FILTER-DAG: Decl[EnumElement]/CurrNominal/IsSystem/TypeRelation[Identical]: none[#Optional<Enum123>#]{{; name=.+$}}
461
+ // BEST_SOLUTION_FILTER-DAG: Decl[EnumElement]/CurrNominal/IsSystem/TypeRelation[Identical]: some({#Enum123#})[#Optional<Enum123>#]{{; name=.+$}}
462
+ // BEST_SOLUTION_FILTER: End completions
You can’t perform that action at this time.
0 commit comments