Skip to content

Commit 430307a

Browse files
committed
[CoroutineAccessors] Don't synthesize overrides.
Such storage decls don't actually have entries in the wtable.
1 parent 73de4de commit 430307a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/Sema/TypeCheckStorage.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,9 @@ bool AccessorDecl::doesAccessorHaveBody() const {
950950
if (!requiresFeatureCoroutineAccessors(accessor->getAccessorKind())) {
951951
return false;
952952
}
953+
if (storage->getOverrideLoc()) {
954+
return false;
955+
}
953956
return accessor->getStorage()
954957
->requiresCorrespondingUnderscoredCoroutineAccessor(
955958
accessor->getAccessorKind(), accessor);

test/TBD/coroutine_accessors.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ public protocol P {
1717

1818
var s: S { read set }
1919
}
20+
21+
public protocol Q : P {
22+
override var s: S { read set }
23+
}

0 commit comments

Comments
 (0)