[Sema] Non-requirement protocol members should inherit @usableFromInline

Previously, members of protocols that were not protocol requirements,
like accessors and typealiases, did not inherit @usableFromInline from
the parent protocol. Change this so they do.
This commit is contained in:
Harlan Haskins
2018-12-07 12:45:17 -08:00
parent 4adc80a8cf
commit d30a3da32a
3 changed files with 20 additions and 2 deletions

View File

@@ -2439,8 +2439,7 @@ bool ValueDecl::isUsableFromInline() const {
return true;
if (auto *containingProto = dyn_cast<ProtocolDecl>(getDeclContext())) {
if (isProtocolRequirement() &&
containingProto->getAttrs().hasAttribute<UsableFromInlineAttr>())
if (containingProto->getAttrs().hasAttribute<UsableFromInlineAttr>())
return true;
}