mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Handle nested types of concrete types in the constraint solver.
... I have no idea why we were foolishly mapping such things to their parent type, which made no sense whatsoever. Fixes rdar://problem/21621421. Swift SVN r29882
This commit is contained in:
@@ -468,7 +468,17 @@ namespace {
|
||||
[&]() -> TypeVariableType* {
|
||||
auto implArchetype = baseTypeVar->getImpl().getArchetype();
|
||||
if (!implArchetype) {
|
||||
return baseTypeVar;
|
||||
// If the base type variable doesn't have an associated archetype,
|
||||
// just form the member constraint.
|
||||
// FIXME: Additional requirements?
|
||||
auto locator = CS.getConstraintLocator(
|
||||
Locator.withPathElement(member));
|
||||
auto memberTypeVar = CS.createTypeVariable(locator,
|
||||
TVO_PrefersSubtypeBinding);
|
||||
CS.addConstraint(Constraint::create(CS, ConstraintKind::TypeMember,
|
||||
baseTypeVar, memberTypeVar,
|
||||
member->getName(), locator));
|
||||
return memberTypeVar;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user