[CSSolver] Split `getType(ValueDecl*) into three - getType{OrNull, OrInterfaceType}

This commit is contained in:
Pavel Yaskevich
2018-06-05 23:38:22 -07:00
parent 398abdfb7c
commit d62be440ce
2 changed files with 18 additions and 12 deletions

View File

@@ -1017,7 +1017,7 @@ ConstraintSystem::getTypeOfReference(ValueDecl *value,
// Determine the type of the value, opening up that type if necessary.
bool wantInterfaceType = !varDecl->getDeclContext()->isLocalContext();
Type valueType = TC.getUnopenedTypeOfReference(
varDecl, Type(), DC, getType(varDecl, false), base, wantInterfaceType);
varDecl, Type(), DC, getTypeOrNull(varDecl), base, wantInterfaceType);
assert(!valueType->hasUnboundGenericType() &&
!valueType->hasTypeParameter());
@@ -1338,8 +1338,8 @@ ConstraintSystem::getTypeOfMemberReference(
AnyFunctionType::ExtInfo());
} else {
refType = TC.getUnopenedTypeOfReference(cast<VarDecl>(value), baseTy,
useDC, getType(value, false),
base, /*wantInterfaceType=*/true);
useDC, getTypeOrNull(value), base,
/*wantInterfaceType=*/true);
}
auto selfTy = outerDC->getSelfInterfaceType();