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(
2365
2365
return true ;
2366
2366
}
2367
2367
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
+
2368
2380
return false ;
2369
2381
});
2370
2382
Original file line number Diff line number Diff line change @@ -16,15 +16,23 @@ struct DatabaseLog {
16
16
}
17
17
}
18
18
19
- extension Sequence {
20
- public func count(
21
- where predicate: ( Element ) throws -> Bool
22
- ) rethrows -> Int { 0 }
23
- }
24
-
25
19
26
20
func rdar47742750( arr1: [ Int ] , arr2: [ Int ] ? ) {
27
21
let _ = {
28
22
assert ( arr1. count == arr1. count + ( arr2 == nil ? 0 : 1 + arr2!. count + arr2!. count + arr2!. count) )
29
23
}
30
24
}
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