File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -2790,10 +2790,7 @@ class ConstraintSystem {
2790
2790
if (formBindingScore (x) < formBindingScore (y))
2791
2791
return true ;
2792
2792
2793
- if (!x.hasNonDefaultableBindings ())
2794
- return false ;
2795
-
2796
- if (x.FullyBound || x.SubtypeOfExistentialType )
2793
+ if (formBindingScore (y) < formBindingScore (x))
2797
2794
return false ;
2798
2795
2799
2796
// If the only difference is default types,
Original file line number Diff line number Diff line change @@ -561,3 +561,20 @@ do {
561
561
func rdar35890334( _ arr: inout [ Int ] ) {
562
562
_ = arr. popFirst ( ) // expected-error {{'[Int]' requires the types '[Int]' and 'ArraySlice<Int>' be equivalent to use 'popFirst'}}
563
563
}
564
+
565
+ // rdar://problem/39616039
566
+
567
+ func rdar39616039( ) {
568
+ func foo< V> ( default: V , _ values: [ String : V ] ) -> V {
569
+ return values [ " foo " ] ?? `default`
570
+ }
571
+
572
+ var a = foo ( default: 42 , [ " foo " : 0 ] )
573
+ a += 1 // ok
574
+
575
+ var b = foo ( default: 42.0 , [ " foo " : 0 ] )
576
+ b += 1 // ok
577
+
578
+ var c = foo ( default: 42.0 , [ " foo " : Float ( 0 ) ] )
579
+ c += 1 // ok
580
+ }
You can’t perform that action at this time.
0 commit comments