Skip to content

Commit 4e476ff

Browse files
authored
Merge pull request #27326 from CodaFi/interface-to-face
2 parents 108a462 + 50d9ab6 commit 4e476ff

File tree

5 files changed

+4
-31
lines changed

5 files changed

+4
-31
lines changed

lib/IDE/CodeCompletion.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ calculateTypeRelationForDecl(const Decl *D, Type ExpectedType,
868868
bool UseFuncResultType = true) {
869869
auto VD = dyn_cast<ValueDecl>(D);
870870
auto DC = D->getDeclContext();
871-
if (!VD || !VD->hasInterfaceType())
871+
if (!VD || !VD->getInterfaceType())
872872
return CodeCompletionResult::ExpectedTypeRelation::Unrelated;
873873

874874
if (auto FD = dyn_cast<AbstractFunctionDecl>(VD)) {
@@ -2431,7 +2431,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
24312431
addTypeAnnotation(Builder, AFT->getResult());
24322432
};
24332433

2434-
if (!AFD || !AFD->hasInterfaceType() ||
2434+
if (!AFD || !AFD->getInterfaceType() ||
24352435
!AFD->getInterfaceType()->is<AnyFunctionType>()) {
24362436
// Probably, calling closure type expression.
24372437
foundFunction(AFT);
@@ -2792,8 +2792,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
27922792
setClangDeclKeywords(TAD, Pairs, Builder);
27932793
addLeadingDot(Builder);
27942794
Builder.addTextChunk(TAD->getName().str());
2795-
if (TAD->hasInterfaceType()) {
2796-
auto underlyingType = TAD->getUnderlyingType();
2795+
if (auto underlyingType = TAD->getUnderlyingType()) {
27972796
if (underlyingType->hasError()) {
27982797
Type parentType;
27992798
if (auto nominal = TAD->getDeclContext()->getSelfNominalTypeDecl()) {
@@ -3143,9 +3142,6 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
31433142

31443143
bool handleEnumElement(ValueDecl *D, DeclVisibilityKind Reason,
31453144
DynamicLookupInfo dynamicLookupInfo) {
3146-
// FIXME(InterfaceTypeRequest): Remove this.
3147-
(void)D->getInterfaceType();
3148-
31493145
if (auto *EED = dyn_cast<EnumElementDecl>(D)) {
31503146
addEnumElementRef(EED, Reason, dynamicLookupInfo,
31513147
/*HasTypeContext=*/true);
@@ -3154,8 +3150,6 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
31543150
llvm::DenseSet<EnumElementDecl *> Elements;
31553151
ED->getAllElements(Elements);
31563152
for (auto *Ele : Elements) {
3157-
// FIXME(InterfaceTypeRequest): Remove this.
3158-
(void)Ele->getInterfaceType();
31593153
addEnumElementRef(Ele, Reason, dynamicLookupInfo,
31603154
/*HasTypeContext=*/true);
31613155
}
@@ -4329,9 +4323,6 @@ class CompletionOverrideLookup : public swift::VisibleDeclConsumer {
43294323
(D->isStatic() && D->getAttrs().hasAttribute<HasInitialValueAttr>()))
43304324
return;
43314325

4332-
// FIXME(InterfaceTypeRequest): Remove this.
4333-
(void)D->getInterfaceType();
4334-
43354326
bool hasIntroducer = hasFuncIntroducer ||
43364327
hasVarIntroducer ||
43374328
hasTypealiasIntroducer;

lib/Sema/CSApply.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,9 +1740,6 @@ namespace {
17401740
return nullptr;
17411741
}
17421742

1743-
// FIXME(InterfaceTypeRequest): Remove this.
1744-
(void)fn->getInterfaceType();
1745-
17461743
// Form a reference to the function. The bridging operations are generic,
17471744
// so we need to form substitutions and compute the resulting type.
17481745
auto genericSig = fn->getGenericSignature();
@@ -1921,14 +1918,12 @@ namespace {
19211918
auto maxFloatTypeDecl = tc.Context.get_MaxBuiltinFloatTypeDecl();
19221919

19231920
if (!maxFloatTypeDecl ||
1924-
!maxFloatTypeDecl->hasInterfaceType() ||
1921+
!maxFloatTypeDecl->getInterfaceType() ||
19251922
!maxFloatTypeDecl->getDeclaredInterfaceType()->is<BuiltinFloatType>()) {
19261923
tc.diagnose(expr->getLoc(), diag::no_MaxBuiltinFloatType_found);
19271924
return nullptr;
19281925
}
19291926

1930-
// FIXME(InterfaceTypeRequest): Remove this.
1931-
(void)maxFloatTypeDecl->getInterfaceType();
19321927
auto maxType = maxFloatTypeDecl->getUnderlyingType();
19331928

19341929
DeclName initName(tc.Context, DeclBaseName::createConstructor(),
@@ -4118,8 +4113,6 @@ namespace {
41184113
assert(method && "Didn't find a method?");
41194114

41204115
// The declaration we found must be exposed to Objective-C.
4121-
// FIXME(InterfaceTypeRequest): Remove this.
4122-
(void)method->getInterfaceType();
41234116
if (!method->isObjC()) {
41244117
// If the method declaration lies in a protocol and we're providing
41254118
// a default implementation of the method through a protocol extension

lib/Sema/DerivedConformanceRawRepresentable.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,6 @@ static bool canSynthesizeRawRepresentable(DerivedConformance &derived) {
465465
auto enumDecl = cast<EnumDecl>(derived.Nominal);
466466
auto &tc = derived.TC;
467467

468-
// Validate the enum and its raw type.
469-
// FIXME(InterfaceTypeRequest): Remove this.
470-
(void)enumDecl->getInterfaceType();
471-
472-
// It must have a valid raw type.
473468
Type rawType = enumDecl->getRawType();
474469
if (!rawType)
475470
return false;

lib/Sema/LookupVisibleDecls.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ static bool isDeclVisibleInLookupMode(ValueDecl *Member, LookupState LS,
125125
// Accessors are never visible directly in the source language.
126126
if (isa<AccessorDecl>(Member))
127127
return false;
128-
129-
// FIXME(InterfaceTypeRequest): Remove this.
130-
(void)Member->getInterfaceType();
131128

132129
// Check access when relevant.
133130
if (!Member->getDeclContext()->isLocalContext() &&

lib/Sema/TypeCheckSwitchStmt.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,9 +1423,6 @@ namespace {
14231423
}
14241424
case PatternKind::EnumElement: {
14251425
auto *VP = cast<EnumElementPattern>(item);
1426-
// FIXME(InterfaceTypeRequest): Remove this.
1427-
(void)item->getType()->getEnumOrBoundGenericEnum()->getInterfaceType();
1428-
14291426
auto *SP = VP->getSubPattern();
14301427
if (!SP) {
14311428
// If there's no sub-pattern then there's no further recursive

0 commit comments

Comments
 (0)