Skip to content

Commit 91d9940

Browse files
committed
---
yaml --- r: 348845 b: refs/heads/master c: 7063ecd h: refs/heads/master i: 348843: 394cdcd
1 parent 4fc4948 commit 91d9940

File tree

4 files changed

+7
-35
lines changed

4 files changed

+7
-35
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: d1735599b9a154ce051025945b13de61c19e72c3
2+
refs/heads/master: 7063ecd3388f71fd919de9997324460a7a2860c7
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/include/swift/Sema/IDETypeChecking.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ namespace swift {
3636
class ValueDecl;
3737
class DeclName;
3838

39-
/// Typecheck a declaration parsed during code completion.
40-
void typeCheckCompletionDecl(Decl *D);
41-
4239
/// Typecheck binding initializer at \p bindingIndex.
4340
void typeCheckPatternBinding(PatternBindingDecl *PBD, unsigned bindingIndex);
4441

trunk/lib/IDE/ExprContextAnalysis.cpp

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ void typeCheckContextImpl(DeclContext *DC, SourceLoc Loc) {
5252
case DeclContextKind::SerializedLocal:
5353
case DeclContextKind::TopLevelCodeDecl:
5454
case DeclContextKind::EnumElementDecl:
55+
case DeclContextKind::GenericTypeDecl:
56+
case DeclContextKind::SubscriptDecl:
5557
// Nothing to do for these.
5658
break;
5759

@@ -61,7 +63,7 @@ void typeCheckContextImpl(DeclContext *DC, SourceLoc Loc) {
6163
auto i = patternInit->getBindingIndex();
6264
if (PBD->getInit(i)) {
6365
PBD->getPattern(i)->forEachVariable([](VarDecl *VD) {
64-
typeCheckCompletionDecl(VD);
66+
(void) VD->getInterfaceType();
6567
});
6668
if (!PBD->isInitializerChecked(i))
6769
typeCheckPatternBinding(PBD, i);
@@ -72,29 +74,18 @@ void typeCheckContextImpl(DeclContext *DC, SourceLoc Loc) {
7274

7375
case DeclContextKind::AbstractFunctionDecl: {
7476
auto *AFD = cast<AbstractFunctionDecl>(DC);
75-
76-
// FIXME: This shouldn't be necessary, but we crash otherwise.
77-
if (auto *AD = dyn_cast<AccessorDecl>(AFD))
78-
typeCheckCompletionDecl(AD->getStorage());
79-
8077
typeCheckAbstractFunctionBodyUntil(AFD, Loc);
8178
break;
8279
}
8380

8481
case DeclContextKind::ExtensionDecl:
85-
typeCheckCompletionDecl(cast<ExtensionDecl>(DC));
86-
break;
87-
88-
case DeclContextKind::GenericTypeDecl:
89-
typeCheckCompletionDecl(cast<GenericTypeDecl>(DC));
82+
// Make sure the extension has been bound, in case it is in an
83+
// inactive #if or something weird like that.
84+
cast<ExtensionDecl>(DC)->computeExtendedNominal();
9085
break;
9186

9287
case DeclContextKind::FileUnit:
9388
llvm_unreachable("module scope context handled above");
94-
95-
case DeclContextKind::SubscriptDecl:
96-
typeCheckCompletionDecl(cast<SubscriptDecl>(DC));
97-
break;
9889
}
9990
}
10091
} // anonymous namespace

trunk/lib/Sema/TypeChecker.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -618,22 +618,6 @@ swift::handleSILGenericParams(ASTContext &Ctx, GenericParamList *genericParams,
618618
return createTypeChecker(Ctx).handleSILGenericParams(genericParams, DC);
619619
}
620620

621-
void swift::typeCheckCompletionDecl(Decl *D) {
622-
auto &Ctx = D->getASTContext();
623-
624-
DiagnosticSuppression suppression(Ctx.Diags);
625-
(void)createTypeChecker(Ctx);
626-
if (auto ext = dyn_cast<ExtensionDecl>(D)) {
627-
if (auto *nominal = ext->computeExtendedNominal()) {
628-
// FIXME(InterfaceTypeRequest): Remove this.
629-
(void)nominal->getInterfaceType();
630-
}
631-
} else {
632-
// FIXME(InterfaceTypeRequest): Remove this.
633-
(void)cast<ValueDecl>(D)->getInterfaceType();
634-
}
635-
}
636-
637621
void swift::typeCheckPatternBinding(PatternBindingDecl *PBD,
638622
unsigned bindingIndex) {
639623
assert(!PBD->isInitializerChecked(bindingIndex) &&

0 commit comments

Comments
 (0)