Skip to content

Commit 2426527

Browse files
authored
Merge pull request #20955 from slavapestov/remove-redundant-method
AST: Remove FuncDecl::getReturnTypeLoc()
2 parents 8db5774 + fc8f122 commit 2426527

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

include/swift/AST/Decl.h

-4
Original file line numberDiff line numberDiff line change
@@ -5631,10 +5631,6 @@ class FuncDecl : public AbstractFunctionDecl {
56315631
return getSelfAccessKind() == SelfAccessKind::__Consuming;
56325632
}
56335633

5634-
TypeLoc getReturnTypeLoc() const {
5635-
return FnRetType;
5636-
}
5637-
56385634
SelfAccessKind getSelfAccessKind() const {
56395635
return static_cast<SelfAccessKind>(Bits.FuncDecl.SelfAccess);
56405636
}

lib/IDE/SyntaxModel.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ bool ModelASTWalker::walkToDeclPre(Decl *D) {
749749
AFD->getSignatureSourceRange());
750750
if (FD) {
751751
SN.TypeRange = charSourceRangeFromSourceRange(SM,
752-
FD->getReturnTypeLoc().getSourceRange());
752+
FD->getBodyResultTypeLoc().getSourceRange());
753753
}
754754
pushStructureNode(SN, AFD);
755755
} else if (auto *NTD = dyn_cast<NominalTypeDecl>(D)) {

lib/Sema/TypeCheckProtocol.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4940,7 +4940,7 @@ diagnoseMissingAppendInterpolationMethod(TypeChecker &tc,
49404940
break;
49414941

49424942
case InvalidMethod::Reason::ReturnType:
4943-
tc.diagnose(invalidMethod.method->getReturnTypeLoc().getLoc(),
4943+
tc.diagnose(invalidMethod.method->getBodyResultTypeLoc().getLoc(),
49444944
diag::append_interpolation_void_or_discardable)
49454945
.fixItInsert(invalidMethod.method->getStartLoc(),
49464946
"@discardableResult ");

0 commit comments

Comments
 (0)