Skip to content

Commit abbc37e

Browse files
committed
IDE: Replace a couple of getTypeOfMember() calls
1 parent 834574d commit abbc37e

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

tools/SourceKit/lib/SwiftLang/SwiftConformingMethodList.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ deliverResults(SourceKit::ConformingMethodListConsumer &SKConsumer,
7777
Members.emplace_back();
7878
auto &memberElem = Members.back();
7979

80-
auto funcTy = cast<FuncDecl>(member)->getMethodInterfaceType();
81-
funcTy = Result->Result->ExprType->getTypeOfMember(
82-
member, funcTy);
83-
auto resultTy = funcTy->castTo<FunctionType>()->getResult();
80+
auto resultTy = cast<FuncDecl>(member)->getResultInterfaceType();
81+
resultTy = resultTy.subst(
82+
Result->Result->ExprType->getMemberSubstitutionMap(member));
8483

8584
// Name.
8685
memberElem.DeclNameBegin = SS.size();

tools/swift-ide-test/swift-ide-test.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1229,9 +1229,9 @@ static int printConformingMethodList(
12291229
llvm::outs() << " []";
12301230
llvm::outs() << "\n";
12311231
for (auto VD : Result->Members) {
1232-
auto funcTy = cast<FuncDecl>(VD)->getMethodInterfaceType();
1233-
funcTy = Result->ExprType->getTypeOfMember(VD, funcTy);
1234-
auto resultTy = funcTy->castTo<FunctionType>()->getResult();
1232+
auto resultTy = cast<FuncDecl>(VD)->getResultInterfaceType();
1233+
resultTy = resultTy.subst(
1234+
Result->ExprType->getMemberSubstitutionMap(VD));
12351235

12361236
llvm::outs() << " - Name: ";
12371237
VD->getName().print(llvm::outs());

0 commit comments

Comments
 (0)