Only reflect NSString categories (outside of Foundation) on String.

This removes my bridging over-generalization <rdar://problem/17526544>.


Swift SVN r19430
This commit is contained in:
Doug Gregor
2014-07-01 21:43:23 +00:00
parent dcb93242f0
commit eb8bd789d5
2 changed files with 5 additions and 5 deletions

View File

@@ -2713,11 +2713,11 @@ ConstraintSystem::simplifyMemberConstraint(const Constraint &constraint) {
// Introduce a new overload set to capture the choices.
SmallVector<OverloadChoice, 4> choices;
// If the instance type is a bridged to an Objective-C type, compute
// If the instance type is String bridged to NSString, compute
// the type we'll look in for bridging.
Type bridgedClass;
Type bridgedType;
if (!instanceTy->isBridgeableObjectType()) {
if (instanceTy->getAnyNominal() == TC.Context.getStringDecl()) {
if (Type classType = TC.getBridgedToObjC(DC, instanceTy).first) {
bridgedClass = classType;
bridgedType = isMetatype ? MetatypeType::get(classType) : classType;