[SourceKit] Fix unreachable hit in DocumentStructureWalker

Resolves rdar://problem/61967092
This commit is contained in:
Nathan Hawes
2020-04-24 15:34:46 -07:00
parent 82d73b531b
commit 43eceef394
5 changed files with 157 additions and 5 deletions

View File

@@ -1363,8 +1363,10 @@ public:
// We only vend the selector name for @IBAction and @IBSegueAction methods.
if (auto FuncD = dyn_cast_or_null<FuncDecl>(D)) {
if (FuncD->getAttrs().hasAttribute<IBActionAttr>() ||
FuncD->getAttrs().hasAttribute<IBSegueActionAttr>())
return FuncD->getObjCSelector().getString(Buf);
FuncD->getAttrs().hasAttribute<IBSegueActionAttr>()) {
return FuncD->getObjCSelector(DeclName(), /*skipIsObjCResolution*/true)
.getString(Buf);
}
}
return StringRef();
}