mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
IDE: Replace some calls to getDeclaredType() with getDeclaredInterfaceType()
This commit is contained in:
@@ -1749,11 +1749,11 @@ static Type
|
|||||||
defaultTypeLiteralKind(CodeCompletionLiteralKind kind, ASTContext &Ctx) {
|
defaultTypeLiteralKind(CodeCompletionLiteralKind kind, ASTContext &Ctx) {
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
case CodeCompletionLiteralKind::BooleanLiteral:
|
case CodeCompletionLiteralKind::BooleanLiteral:
|
||||||
return Ctx.getBoolDecl()->getDeclaredType();
|
return Ctx.getBoolDecl()->getDeclaredInterfaceType();
|
||||||
case CodeCompletionLiteralKind::IntegerLiteral:
|
case CodeCompletionLiteralKind::IntegerLiteral:
|
||||||
return Ctx.getIntDecl()->getDeclaredType();
|
return Ctx.getIntDecl()->getDeclaredInterfaceType();
|
||||||
case CodeCompletionLiteralKind::StringLiteral:
|
case CodeCompletionLiteralKind::StringLiteral:
|
||||||
return Ctx.getStringDecl()->getDeclaredType();
|
return Ctx.getStringDecl()->getDeclaredInterfaceType();
|
||||||
case CodeCompletionLiteralKind::ArrayLiteral:
|
case CodeCompletionLiteralKind::ArrayLiteral:
|
||||||
return Ctx.getArrayDecl()->getDeclaredType();
|
return Ctx.getArrayDecl()->getDeclaredType();
|
||||||
case CodeCompletionLiteralKind::DictionaryLiteral:
|
case CodeCompletionLiteralKind::DictionaryLiteral:
|
||||||
@@ -4130,7 +4130,7 @@ public:
|
|||||||
builder.addRightBracket();
|
builder.addRightBracket();
|
||||||
});
|
});
|
||||||
|
|
||||||
auto floatType = context.getFloatDecl()->getDeclaredType();
|
auto floatType = context.getFloatDecl()->getDeclaredInterfaceType();
|
||||||
addFromProto(LK::ColorLiteral, [&](Builder &builder) {
|
addFromProto(LK::ColorLiteral, [&](Builder &builder) {
|
||||||
builder.addBaseName("#colorLiteral");
|
builder.addBaseName("#colorLiteral");
|
||||||
builder.addLeftParen();
|
builder.addLeftParen();
|
||||||
@@ -4144,7 +4144,7 @@ public:
|
|||||||
builder.addRightParen();
|
builder.addRightParen();
|
||||||
});
|
});
|
||||||
|
|
||||||
auto stringType = context.getStringDecl()->getDeclaredType();
|
auto stringType = context.getStringDecl()->getDeclaredInterfaceType();
|
||||||
addFromProto(LK::ImageLiteral, [&](Builder &builder) {
|
addFromProto(LK::ImageLiteral, [&](Builder &builder) {
|
||||||
builder.addBaseName("#imageLiteral");
|
builder.addBaseName("#imageLiteral");
|
||||||
builder.addLeftParen();
|
builder.addLeftParen();
|
||||||
|
|||||||
@@ -1518,7 +1518,7 @@ SwiftDeclCollector::constructTypeNode(Type T, TypeInitInfo Info) {
|
|||||||
Root->addChild(constructTypeNode(MTT->getInstanceType()));
|
Root->addChild(constructTypeNode(MTT->getInstanceType()));
|
||||||
} else if (auto ATT = T->getAs<ArchetypeType>()) {
|
} else if (auto ATT = T->getAs<ArchetypeType>()) {
|
||||||
for (auto Pro : ATT->getConformsTo()) {
|
for (auto Pro : ATT->getConformsTo()) {
|
||||||
Root->addChild(constructTypeNode(Pro->getDeclaredType()));
|
Root->addChild(constructTypeNode(Pro->getDeclaredInterfaceType()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Root;
|
return Root;
|
||||||
|
|||||||
@@ -773,7 +773,7 @@ public:
|
|||||||
std::vector<sma::TypeName> Result;
|
std::vector<sma::TypeName> Result;
|
||||||
Result.reserve(AllProtocols.size());
|
Result.reserve(AllProtocols.size());
|
||||||
for (const auto *PD : AllProtocols) {
|
for (const auto *PD : AllProtocols) {
|
||||||
Result.emplace_back(convertToTypeName(PD->getDeclaredType()));
|
Result.emplace_back(convertToTypeName(PD->getDeclaredInterfaceType()));
|
||||||
}
|
}
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user