mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
More progress towards getting same-type constraints working correctly.
Swift SVN r16023
This commit is contained in:
@@ -1189,10 +1189,17 @@ void ConstraintSystem::resolveOverload(ConstraintLocator *locator,
|
||||
// in the case of a conformance check against an associated type rooted off of
|
||||
// "Self"), we'll need to open the type up so as not to short-circuit the
|
||||
// binding constraint against the already bound overload type.
|
||||
if ((choice.getKind() == OverloadChoiceKind::TypeDecl) &&
|
||||
refType->getAs<DependentMemberType>()) {
|
||||
if (refType->isDependentType()) {
|
||||
openedFullType = openType(openedFullType,
|
||||
choice.getDecl()->
|
||||
getPotentialGenericDeclContext());
|
||||
refType = openType(refType,
|
||||
choice.getDecl()->getPotentialGenericDeclContext());
|
||||
|
||||
if (auto FT = openedFullType->getAs<FunctionType>()) {
|
||||
auto returnType = FT->getResult();
|
||||
addConstraint(ConstraintKind::Bind, returnType, refType);
|
||||
}
|
||||
}
|
||||
|
||||
// Add the type binding constraint.
|
||||
|
||||
Reference in New Issue
Block a user