File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
validation-test/IDE/crashers_2_fixed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,11 @@ void ConformingMethodListCallbacks::doneParsing() {
9090 if (T->hasArchetype ())
9191 T = T->mapTypeOutOfContext ();
9292
93+ // If there are no (instance) members for this type, bail.
94+ if (!T->mayHaveMembers () || T->is <ModuleType>()) {
95+ return ;
96+ }
97+
9398 llvm::SmallPtrSet<ProtocolDecl*, 8 > expectedProtocols;
9499 for (auto Name: ExpectedTypeNames) {
95100 if (auto *PD = resolveProtocolName (CurDeclContext, Name)) {
@@ -107,8 +112,7 @@ void ConformingMethodListCallbacks::doneParsing() {
107112void ConformingMethodListCallbacks::getMatchingMethods (
108113 Type T, llvm::SmallPtrSetImpl<ProtocolDecl*> &expectedTypes,
109114 SmallVectorImpl<ValueDecl *> &result) {
110- if (!T->mayHaveMembers ())
111- return ;
115+ assert (T->mayHaveMembers () && !T->is <ModuleType>());
112116
113117 class LocalConsumer : public VisibleDeclConsumer {
114118 ModuleDecl *CurModule;
Original file line number Diff line number Diff line change 1+ // RUN: %target-swift-ide-test --conforming-methods --conforming-methods-expected-types=s:SQ -source-filename %s -code-completion-token=COMPLETE
2+
3+ Swift#^COMPLETE^#
You can’t perform that action at this time.
0 commit comments