File tree Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -1032,15 +1032,6 @@ bool TypeVarBindingProducer::computeNext() {
1032
1032
}
1033
1033
}
1034
1034
1035
- if (binding.Kind != BindingKind::Supertypes)
1036
- continue ;
1037
-
1038
- for (auto supertype : enumerateDirectSupertypes (type)) {
1039
- // If we're not allowed to try this binding, skip it.
1040
- if (auto simplifiedSuper = CS.checkTypeOfBinding (TypeVar, supertype))
1041
- addNewBinding (binding.withType (*simplifiedSuper));
1042
- }
1043
-
1044
1035
auto srcLocator = binding.getLocator ();
1045
1036
if (srcLocator &&
1046
1037
srcLocator->isLastElement <LocatorPathElt::ApplyArgToParam>() &&
@@ -1059,6 +1050,14 @@ bool TypeVarBindingProducer::computeNext() {
1059
1050
->reconstituteSugar (/* recursive=*/ false );
1060
1051
addNewBinding (binding.withType (newType));
1061
1052
}
1053
+
1054
+ if (binding.Kind == BindingKind::Supertypes) {
1055
+ for (auto supertype : enumerateDirectSupertypes (type)) {
1056
+ // If we're not allowed to try this binding, skip it.
1057
+ if (auto simplifiedSuper = CS.checkTypeOfBinding (TypeVar, supertype))
1058
+ addNewBinding (binding.withType (*simplifiedSuper));
1059
+ }
1060
+ }
1062
1061
}
1063
1062
1064
1063
if (newBindings.empty ())
Original file line number Diff line number Diff line change @@ -374,3 +374,12 @@ func bridgeTupleToAnyObject() {
374
374
func rdar54274245( _ arr: [ Any ] ? ) {
375
375
_ = ( arr ?? [ ] ) as [ NSObject ]
376
376
}
377
+
378
+ // rdar://problem/60501780 - failed to infer NSString as a value type of a dictionary
379
+ func rdar60501780( ) {
380
+ func foo( _: [ String : NSObject ] ) { }
381
+
382
+ func bar( _ v: String ) {
383
+ foo ( [ " " : " " , " " : v as NSString ] )
384
+ }
385
+ }
You can’t perform that action at this time.
0 commit comments