Skip to content

Commit d7db48f

Browse files
committed
AST: Decl::isPotentiallyOverridable() returns false for protocol requirements
The way this predicate is used is closely intertwined with 'can have open access'. For example, we don't want protocol requirements coming from testable imports to have 'open' access level.
1 parent ce712db commit d7db48f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

include/swift/AST/Decl.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7177,8 +7177,7 @@ inline bool Decl::isPotentiallyOverridable() const {
71777177
isa<SubscriptDecl>(this) ||
71787178
isa<FuncDecl>(this) ||
71797179
isa<DestructorDecl>(this)) {
7180-
return getDeclContext()->getSelfClassDecl() ||
7181-
isa<ProtocolDecl>(getDeclContext());
7180+
return getDeclContext()->getSelfClassDecl();
71827181
} else {
71837182
return false;
71847183
}

0 commit comments

Comments
 (0)