IDE: Replace some calls to getDeclaredType() with getDeclaredInterfaceType()

This commit is contained in:
Slava Pestov
2020-07-31 13:11:41 -04:00
parent 38477ade9c
commit b4ea644910
3 changed files with 7 additions and 7 deletions

View File

@@ -1749,11 +1749,11 @@ static Type
defaultTypeLiteralKind(CodeCompletionLiteralKind kind, ASTContext &Ctx) {
switch (kind) {
case CodeCompletionLiteralKind::BooleanLiteral:
return Ctx.getBoolDecl()->getDeclaredType();
return Ctx.getBoolDecl()->getDeclaredInterfaceType();
case CodeCompletionLiteralKind::IntegerLiteral:
return Ctx.getIntDecl()->getDeclaredType();
return Ctx.getIntDecl()->getDeclaredInterfaceType();
case CodeCompletionLiteralKind::StringLiteral:
return Ctx.getStringDecl()->getDeclaredType();
return Ctx.getStringDecl()->getDeclaredInterfaceType();
case CodeCompletionLiteralKind::ArrayLiteral:
return Ctx.getArrayDecl()->getDeclaredType();
case CodeCompletionLiteralKind::DictionaryLiteral:
@@ -4130,7 +4130,7 @@ public:
builder.addRightBracket();
});
auto floatType = context.getFloatDecl()->getDeclaredType();
auto floatType = context.getFloatDecl()->getDeclaredInterfaceType();
addFromProto(LK::ColorLiteral, [&](Builder &builder) {
builder.addBaseName("#colorLiteral");
builder.addLeftParen();
@@ -4144,7 +4144,7 @@ public:
builder.addRightParen();
});
auto stringType = context.getStringDecl()->getDeclaredType();
auto stringType = context.getStringDecl()->getDeclaredInterfaceType();
addFromProto(LK::ImageLiteral, [&](Builder &builder) {
builder.addBaseName("#imageLiteral");
builder.addLeftParen();

View File

@@ -1518,7 +1518,7 @@ SwiftDeclCollector::constructTypeNode(Type T, TypeInitInfo Info) {
Root->addChild(constructTypeNode(MTT->getInstanceType()));
} else if (auto ATT = T->getAs<ArchetypeType>()) {
for (auto Pro : ATT->getConformsTo()) {
Root->addChild(constructTypeNode(Pro->getDeclaredType()));
Root->addChild(constructTypeNode(Pro->getDeclaredInterfaceType()));
}
}
return Root;

View File

@@ -773,7 +773,7 @@ public:
std::vector<sma::TypeName> Result;
Result.reserve(AllProtocols.size());
for (const auto *PD : AllProtocols) {
Result.emplace_back(convertToTypeName(PD->getDeclaredType()));
Result.emplace_back(convertToTypeName(PD->getDeclaredInterfaceType()));
}
return Result;
}