mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Update SourceKit for getInterfaceType() changes
This commit is contained in:
@@ -333,8 +333,6 @@ deriveBodyCodingKey_init_stringValue(AbstractFunctionDecl *initDecl, void *) {
|
||||
static bool canSynthesizeCodingKey(DerivedConformance &derived) {
|
||||
auto enumDecl = cast<EnumDecl>(derived.Nominal);
|
||||
// Validate the enum and its raw type.
|
||||
// FIXME(InterfaceTypeRequest): Remove this.
|
||||
(void)enumDecl->getInterfaceType();
|
||||
|
||||
// If the enum has a raw type (optional), it must be String or Int.
|
||||
Type rawType = enumDecl->getRawType();
|
||||
|
||||
@@ -2136,8 +2136,6 @@ static FuncDecl *findReplacedAccessor(DeclName replacedVarName,
|
||||
// Filter out any accessors that won't work.
|
||||
if (!results.empty()) {
|
||||
auto replacementStorage = replacement->getStorage();
|
||||
// FIXME(InterfaceTypeRequest): Remove this.
|
||||
(void)replacementStorage->getInterfaceType();
|
||||
Type replacementStorageType = getDynamicComparisonType(replacementStorage);
|
||||
results.erase(std::remove_if(results.begin(), results.end(),
|
||||
[&](ValueDecl *result) {
|
||||
@@ -2149,8 +2147,6 @@ static FuncDecl *findReplacedAccessor(DeclName replacedVarName,
|
||||
return true;
|
||||
|
||||
// Check for type mismatch.
|
||||
// FIXME(InterfaceTypeRequest): Remove this.
|
||||
(void)result->getInterfaceType();
|
||||
auto resultType = getDynamicComparisonType(result);
|
||||
if (!resultType->isEqual(replacementStorageType) &&
|
||||
!resultType->matches(
|
||||
@@ -2236,8 +2232,6 @@ findReplacedFunction(DeclName replacedFunctionName,
|
||||
if (result->isStatic() != replacement->isStatic())
|
||||
continue;
|
||||
|
||||
// FIXME(InterfaceTypeRequest): Remove this.
|
||||
(void)result->getInterfaceType();
|
||||
TypeMatchOptions matchMode = TypeMatchFlags::AllowABICompatible;
|
||||
matchMode |= TypeMatchFlags::AllowCompatibleOpaqueTypeArchetypes;
|
||||
if (result->getInterfaceType()->getCanonicalType()->matches(
|
||||
|
||||
@@ -764,8 +764,6 @@ AssociatedTypeDecl *AssociatedTypeInference::findDefaultedAssociatedType(
|
||||
TypeChecker &tc,
|
||||
AssociatedTypeDecl *assocType) {
|
||||
// If this associated type has a default, we're done.
|
||||
// FIXME(InterfaceTypeRequest): Remove this.
|
||||
(void)assocType->getInterfaceType();
|
||||
if (assocType->hasDefaultDefinitionType())
|
||||
return assocType;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ func resyncParser2() {}
|
||||
// RUN: %sourcekitd-test -req=cursor -pos=4:13 %s -- %s | %FileCheck -check-prefix=CHECK1 %s
|
||||
// CHECK1: source.lang.swift.decl.var.local (4:13-4:14)
|
||||
// CHECK1: c
|
||||
// CHECK1: <Declaration>let c</Declaration>
|
||||
// CHECK1: <Declaration>let c: <Type usr="s:14cursor_invalid1CC">C</Type></Declaration>
|
||||
// CHECK1: OVERRIDES BEGIN
|
||||
// CHECK1: OVERRIDES END
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ extension CC : Prot {
|
||||
var extV : Int { return 0 }
|
||||
}
|
||||
|
||||
class SubCC : CC, Prot {}
|
||||
class SubCC : CC {}
|
||||
|
||||
var globV2: SubCC
|
||||
|
||||
|
||||
@@ -501,13 +501,6 @@
|
||||
key.usr: <usr>,
|
||||
key.line: 55,
|
||||
key.column: 15
|
||||
},
|
||||
{
|
||||
key.kind: source.lang.swift.ref.protocol,
|
||||
key.name: "Prot",
|
||||
key.usr: <usr>,
|
||||
key.line: 55,
|
||||
key.column: 19
|
||||
}
|
||||
],
|
||||
key.entities: [
|
||||
@@ -532,18 +525,11 @@
|
||||
key.line: 55,
|
||||
key.column: 15
|
||||
},
|
||||
{
|
||||
key.kind: source.lang.swift.ref.protocol,
|
||||
key.name: "Prot",
|
||||
key.usr: <usr>,
|
||||
key.line: 55,
|
||||
key.column: 19
|
||||
},
|
||||
{
|
||||
key.kind: source.lang.swift.decl.function.constructor,
|
||||
key.usr: <usr>,
|
||||
key.line: 55,
|
||||
key.column: 24,
|
||||
key.column: 18,
|
||||
key.is_implicit: 1,
|
||||
key.related: [
|
||||
{
|
||||
@@ -1222,6 +1208,13 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
key.kind: source.lang.swift.decl.function.method.instance,
|
||||
key.name: "meth()",
|
||||
key.usr: <usr>,
|
||||
key.line: 134,
|
||||
key.column: 8
|
||||
},
|
||||
{
|
||||
key.kind: source.lang.swift.decl.class,
|
||||
key.name: "CC4",
|
||||
|
||||
@@ -533,10 +533,9 @@ static void reportRelated(ASTContext &Ctx, const Decl *D,
|
||||
|
||||
} else if (auto *TAD = dyn_cast<TypeAliasDecl>(D)) {
|
||||
|
||||
if (TAD->hasInterfaceType()) {
|
||||
if (auto Ty = TAD->getDeclaredInterfaceType()) {
|
||||
// If underlying type exists, report the inheritance and conformance of the
|
||||
// underlying type.
|
||||
auto Ty = TAD->getDeclaredInterfaceType();
|
||||
if (auto NM = Ty->getAnyNominal()) {
|
||||
passInherits(NM->getInherited(), Consumer);
|
||||
passConforms(NM->getSatisfiedProtocolRequirements(/*Sorted=*/true),
|
||||
|
||||
@@ -778,11 +778,11 @@ static bool passCursorInfoForDecl(SourceFile* SF,
|
||||
unsigned USREnd = SS.size();
|
||||
|
||||
unsigned TypenameBegin = SS.size();
|
||||
if (VD->hasInterfaceType()) {
|
||||
if (auto vdType = VD->getInterfaceType()) {
|
||||
llvm::raw_svector_ostream OS(SS);
|
||||
PrintOptions Options;
|
||||
Options.PrintTypeAliasUnderlyingType = true;
|
||||
VD->getInterfaceType().print(OS, Options);
|
||||
vdType.print(OS, Options);
|
||||
}
|
||||
unsigned TypenameEnd = SS.size();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user