Skip to content

Commit 3cbb827

Browse files
committed
[IDE] Use 'Demangle::getTypeForMangling()' instead of 'getDeclFromMangledSymbolName()'
1 parent 317ec1f commit 3cbb827

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/IDE/ConformingMethodList.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#include "swift/IDE/ConformingMethodList.h"
1314
#include "ExprContextAnalysis.h"
15+
#include "swift/AST/ASTDemangler.h"
1416
#include "swift/AST/GenericEnvironment.h"
1517
#include "swift/AST/NameLookup.h"
1618
#include "swift/AST/USRGeneration.h"
17-
#include "swift/IDE/ConformingMethodList.h"
18-
#include "swift/IDE/Utils.h"
1919
#include "swift/Parse/CodeCompletionCallbacks.h"
2020
#include "swift/Sema/IDETypeChecking.h"
2121
#include "clang/AST/Attr.h"
@@ -106,9 +106,8 @@ void ConformingMethodListCallbacks::resolveExpectedTypes(
106106
auto &ctx = CurDeclContext->getASTContext();
107107

108108
for (auto name : names) {
109-
std::string err;
110-
if (auto D = getDeclFromMangledSymbolName(ctx, name, err)) {
111-
if (auto Proto = dyn_cast<ProtocolDecl>(D))
109+
if (auto ty = Demangle::getTypeForMangling(ctx, name)) {
110+
if (auto Proto = dyn_cast_or_null<ProtocolDecl>(ty->getAnyGeneric()))
112111
result.push_back(Proto);
113112
}
114113
}

0 commit comments

Comments
 (0)