diff --git a/lib/IDE/CodeCompletion.cpp b/lib/IDE/CodeCompletion.cpp index ce807b3ac0f6f..8e98882d1de03 100644 --- a/lib/IDE/CodeCompletion.cpp +++ b/lib/IDE/CodeCompletion.cpp @@ -3313,6 +3313,12 @@ class CompletionLookup final : public swift::VisibleDeclConsumer { } } + // If the right-hand side and result type are both type parameters, we're + // not providing a useful completion. + if (expr->getType()->isTypeParameter() && + CCE.getType()->isTypeParameter()) + return; + addInfixOperatorCompletion(op, expr->getType(), CCE.getType()); } } diff --git a/lib/Sema/ConstraintSystem.cpp b/lib/Sema/ConstraintSystem.cpp index f4af19b6f924b..bdf711307c1b9 100644 --- a/lib/Sema/ConstraintSystem.cpp +++ b/lib/Sema/ConstraintSystem.cpp @@ -468,25 +468,6 @@ namespace { FunctionRefKind::Compound, locator)); - if (!archetype) { - // If the nested type is not an archetype (because it was constrained - // to a concrete type by a requirement), return the fresh type - // variable now, and let binding occur during overload resolution. - return memberTypeVar; - } - - // FIXME: Would be better to walk the requirements of the protocol - // of which the associated type is a member. - if (auto superclass = member->getSuperclass()) { - CS.addConstraint(ConstraintKind::Subtype, memberTypeVar, - superclass, locator); - } - - for (auto proto : member->getConformingProtocols()) { - CS.addConstraint(ConstraintKind::ConformsTo, memberTypeVar, - proto->getDeclaredType(), locator); - } - return memberTypeVar; }); }