mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Don't create locators with null archetypes.
And remove a stray assert(false) that shouldn't be there that I noticed by inspection. Swift SVN r14903
This commit is contained in:
@@ -417,8 +417,9 @@ namespace {
|
||||
auto nestedType = baseTypeVar->getImpl().getArchetype()
|
||||
->getNestedType(member->getName());
|
||||
auto archetype = nestedType.dyn_cast<ArchetypeType*>();
|
||||
auto locator = CS.getConstraintLocator((Expr *)nullptr,
|
||||
LocatorPathElt(archetype));
|
||||
auto locator = archetype
|
||||
? CS.getConstraintLocator((Expr *)nullptr, LocatorPathElt(archetype))
|
||||
: nullptr;
|
||||
auto memberTypeVar = CS.createTypeVariable(locator,
|
||||
TVO_PrefersSubtypeBinding);
|
||||
// Determine whether we should bind the new type variable as a
|
||||
@@ -447,7 +448,6 @@ namespace {
|
||||
|
||||
// Add associated type constraints.
|
||||
if (!archetype) {
|
||||
assert(false);
|
||||
// If the nested type is not an archetype (because it was constrained
|
||||
// to a concrete type by a requirement), bind the type variable
|
||||
// to that type.
|
||||
|
||||
Reference in New Issue
Block a user