Skip to content

Commit 1233cdf

Browse files
committed
Update SourceKit for getInterfaceType() changes
1 parent 792e1db commit 1233cdf

File tree

8 files changed

+13
-31
lines changed

8 files changed

+13
-31
lines changed

lib/Sema/DerivedConformanceCodingKey.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,6 @@ deriveBodyCodingKey_init_stringValue(AbstractFunctionDecl *initDecl, void *) {
333333
static bool canSynthesizeCodingKey(DerivedConformance &derived) {
334334
auto enumDecl = cast<EnumDecl>(derived.Nominal);
335335
// Validate the enum and its raw type.
336-
// FIXME(InterfaceTypeRequest): Remove this.
337-
(void)enumDecl->getInterfaceType();
338336

339337
// If the enum has a raw type (optional), it must be String or Int.
340338
Type rawType = enumDecl->getRawType();

lib/Sema/TypeCheckAttr.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2136,8 +2136,6 @@ static FuncDecl *findReplacedAccessor(DeclName replacedVarName,
21362136
// Filter out any accessors that won't work.
21372137
if (!results.empty()) {
21382138
auto replacementStorage = replacement->getStorage();
2139-
// FIXME(InterfaceTypeRequest): Remove this.
2140-
(void)replacementStorage->getInterfaceType();
21412139
Type replacementStorageType = getDynamicComparisonType(replacementStorage);
21422140
results.erase(std::remove_if(results.begin(), results.end(),
21432141
[&](ValueDecl *result) {
@@ -2149,8 +2147,6 @@ static FuncDecl *findReplacedAccessor(DeclName replacedVarName,
21492147
return true;
21502148

21512149
// Check for type mismatch.
2152-
// FIXME(InterfaceTypeRequest): Remove this.
2153-
(void)result->getInterfaceType();
21542150
auto resultType = getDynamicComparisonType(result);
21552151
if (!resultType->isEqual(replacementStorageType) &&
21562152
!resultType->matches(
@@ -2236,8 +2232,6 @@ findReplacedFunction(DeclName replacedFunctionName,
22362232
if (result->isStatic() != replacement->isStatic())
22372233
continue;
22382234

2239-
// FIXME(InterfaceTypeRequest): Remove this.
2240-
(void)result->getInterfaceType();
22412235
TypeMatchOptions matchMode = TypeMatchFlags::AllowABICompatible;
22422236
matchMode |= TypeMatchFlags::AllowCompatibleOpaqueTypeArchetypes;
22432237
if (result->getInterfaceType()->getCanonicalType()->matches(

lib/Sema/TypeCheckProtocolInference.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,8 +764,6 @@ AssociatedTypeDecl *AssociatedTypeInference::findDefaultedAssociatedType(
764764
TypeChecker &tc,
765765
AssociatedTypeDecl *assocType) {
766766
// If this associated type has a default, we're done.
767-
// FIXME(InterfaceTypeRequest): Remove this.
768-
(void)assocType->getInterfaceType();
769767
if (assocType->hasDefaultDefinitionType())
770768
return assocType;
771769

test/SourceKit/CursorInfo/cursor_invalid.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func resyncParser2() {}
2525
// RUN: %sourcekitd-test -req=cursor -pos=4:13 %s -- %s | %FileCheck -check-prefix=CHECK1 %s
2626
// CHECK1: source.lang.swift.decl.var.local (4:13-4:14)
2727
// CHECK1: c
28-
// CHECK1: <Declaration>let c</Declaration>
28+
// CHECK1: <Declaration>let c: <Type usr="s:14cursor_invalid1CC">C</Type></Declaration>
2929
// CHECK1: OVERRIDES BEGIN
3030
// CHECK1: OVERRIDES END
3131

test/SourceKit/Indexing/index.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ extension CC : Prot {
5252
var extV : Int { return 0 }
5353
}
5454

55-
class SubCC : CC, Prot {}
55+
class SubCC : CC {}
5656

5757
var globV2: SubCC
5858

test/SourceKit/Indexing/index.swift.response

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -501,13 +501,6 @@
501501
key.usr: <usr>,
502502
key.line: 55,
503503
key.column: 15
504-
},
505-
{
506-
key.kind: source.lang.swift.ref.protocol,
507-
key.name: "Prot",
508-
key.usr: <usr>,
509-
key.line: 55,
510-
key.column: 19
511504
}
512505
],
513506
key.entities: [
@@ -532,18 +525,11 @@
532525
key.line: 55,
533526
key.column: 15
534527
},
535-
{
536-
key.kind: source.lang.swift.ref.protocol,
537-
key.name: "Prot",
538-
key.usr: <usr>,
539-
key.line: 55,
540-
key.column: 19
541-
},
542528
{
543529
key.kind: source.lang.swift.decl.function.constructor,
544530
key.usr: <usr>,
545531
key.line: 55,
546-
key.column: 24,
532+
key.column: 18,
547533
key.is_implicit: 1,
548534
key.related: [
549535
{
@@ -1222,6 +1208,13 @@
12221208
}
12231209
]
12241210
},
1211+
{
1212+
key.kind: source.lang.swift.decl.function.method.instance,
1213+
key.name: "meth()",
1214+
key.usr: <usr>,
1215+
key.line: 134,
1216+
key.column: 8
1217+
},
12251218
{
12261219
key.kind: source.lang.swift.decl.class,
12271220
key.name: "CC4",

tools/SourceKit/lib/SwiftLang/SwiftDocSupport.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,10 +533,9 @@ static void reportRelated(ASTContext &Ctx, const Decl *D,
533533

534534
} else if (auto *TAD = dyn_cast<TypeAliasDecl>(D)) {
535535

536-
if (TAD->hasInterfaceType()) {
536+
if (auto Ty = TAD->getDeclaredInterfaceType()) {
537537
// If underlying type exists, report the inheritance and conformance of the
538538
// underlying type.
539-
auto Ty = TAD->getDeclaredInterfaceType();
540539
if (auto NM = Ty->getAnyNominal()) {
541540
passInherits(NM->getInherited(), Consumer);
542541
passConforms(NM->getSatisfiedProtocolRequirements(/*Sorted=*/true),

tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,11 +778,11 @@ static bool passCursorInfoForDecl(SourceFile* SF,
778778
unsigned USREnd = SS.size();
779779

780780
unsigned TypenameBegin = SS.size();
781-
if (VD->hasInterfaceType()) {
781+
if (auto vdType = VD->getInterfaceType()) {
782782
llvm::raw_svector_ostream OS(SS);
783783
PrintOptions Options;
784784
Options.PrintTypeAliasUnderlyingType = true;
785-
VD->getInterfaceType().print(OS, Options);
785+
vdType.print(OS, Options);
786786
}
787787
unsigned TypenameEnd = SS.size();
788788

0 commit comments

Comments
 (0)