Skip to content

Commit b4ea644

Browse files
committed
IDE: Replace some calls to getDeclaredType() with getDeclaredInterfaceType()
1 parent 38477ad commit b4ea644

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/IDE/CodeCompletion.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,11 +1749,11 @@ static Type
17491749
defaultTypeLiteralKind(CodeCompletionLiteralKind kind, ASTContext &Ctx) {
17501750
switch (kind) {
17511751
case CodeCompletionLiteralKind::BooleanLiteral:
1752-
return Ctx.getBoolDecl()->getDeclaredType();
1752+
return Ctx.getBoolDecl()->getDeclaredInterfaceType();
17531753
case CodeCompletionLiteralKind::IntegerLiteral:
1754-
return Ctx.getIntDecl()->getDeclaredType();
1754+
return Ctx.getIntDecl()->getDeclaredInterfaceType();
17551755
case CodeCompletionLiteralKind::StringLiteral:
1756-
return Ctx.getStringDecl()->getDeclaredType();
1756+
return Ctx.getStringDecl()->getDeclaredInterfaceType();
17571757
case CodeCompletionLiteralKind::ArrayLiteral:
17581758
return Ctx.getArrayDecl()->getDeclaredType();
17591759
case CodeCompletionLiteralKind::DictionaryLiteral:
@@ -4130,7 +4130,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
41304130
builder.addRightBracket();
41314131
});
41324132

4133-
auto floatType = context.getFloatDecl()->getDeclaredType();
4133+
auto floatType = context.getFloatDecl()->getDeclaredInterfaceType();
41344134
addFromProto(LK::ColorLiteral, [&](Builder &builder) {
41354135
builder.addBaseName("#colorLiteral");
41364136
builder.addLeftParen();
@@ -4144,7 +4144,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
41444144
builder.addRightParen();
41454145
});
41464146

4147-
auto stringType = context.getStringDecl()->getDeclaredType();
4147+
auto stringType = context.getStringDecl()->getDeclaredInterfaceType();
41484148
addFromProto(LK::ImageLiteral, [&](Builder &builder) {
41494149
builder.addBaseName("#imageLiteral");
41504150
builder.addLeftParen();

tools/swift-api-digester/ModuleAnalyzerNodes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@ SwiftDeclCollector::constructTypeNode(Type T, TypeInitInfo Info) {
15181518
Root->addChild(constructTypeNode(MTT->getInstanceType()));
15191519
} else if (auto ATT = T->getAs<ArchetypeType>()) {
15201520
for (auto Pro : ATT->getConformsTo()) {
1521-
Root->addChild(constructTypeNode(Pro->getDeclaredType()));
1521+
Root->addChild(constructTypeNode(Pro->getDeclaredInterfaceType()));
15221522
}
15231523
}
15241524
return Root;

tools/swift-ide-test/ModuleAPIDiff.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ class SMAModelGenerator : public DeclVisitor<SMAModelGenerator> {
773773
std::vector<sma::TypeName> Result;
774774
Result.reserve(AllProtocols.size());
775775
for (const auto *PD : AllProtocols) {
776-
Result.emplace_back(convertToTypeName(PD->getDeclaredType()));
776+
Result.emplace_back(convertToTypeName(PD->getDeclaredInterfaceType()));
777777
}
778778
return Result;
779779
}

0 commit comments

Comments
 (0)