File tree Expand file tree Collapse file tree 2 files changed +26
-6
lines changed
validation-test/Sema/type_checker_perf/fast Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -2365,6 +2365,18 @@ void DisjunctionChoiceProducer::partitionDisjunction(
23652365 return true ;
23662366 }
23672367
2368+ // Order VarDecls before other kinds of declarations because they are
2369+ // effectively favored over functions when the two are in the same
2370+ // overload set. This disjunction order allows SK_UnappliedFunction
2371+ // to prune later overload choices that are functions when a solution
2372+ // has already been found with a property.
2373+ if (auto *decl = getOverloadChoiceDecl (constraint)) {
2374+ if (isa<VarDecl>(decl)) {
2375+ everythingElse.push_back (index);
2376+ return true ;
2377+ }
2378+ }
2379+
23682380 return false ;
23692381 });
23702382
Original file line number Diff line number Diff line change @@ -16,15 +16,23 @@ struct DatabaseLog {
1616 }
1717}
1818
19- extension Sequence {
20- public func count(
21- where predicate: ( Element ) throws -> Bool
22- ) rethrows -> Int { 0 }
23- }
24-
2519
2620func rdar47742750( arr1: [ Int ] , arr2: [ Int ] ? ) {
2721 let _ = {
2822 assert ( arr1. count == arr1. count + ( arr2 == nil ? 0 : 1 + arr2!. count + arr2!. count + arr2!. count) )
2923 }
3024}
25+
26+ func f(
27+ a: String ? ,
28+ b: String ? ,
29+ c: Int ,
30+ d: String ? ,
31+ e: String ?
32+ ) -> Int {
33+ return ( a? . unicodeScalars. count ?? 0 ) +
34+ ( b? . unicodeScalars. count ?? 0 ) +
35+ c +
36+ ( d? . unicodeScalars. count ?? 0 ) +
37+ ( e? . unicodeScalars. count ?? 0 )
38+ }
You can’t perform that action at this time.
0 commit comments