Skip to content

Commit 73de4de

Browse files
committed
[CoroutineAccessors] TBDify synthesized defaults.
1 parent e76dc2d commit 73de4de

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

lib/SIL/IR/SILSymbolVisitor.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,11 @@ class SILSymbolVisitorImpl : public ASTVisitor<SILSymbolVisitorImpl> {
823823
Visitor.addDispatchThunk(declRef);
824824
Visitor.addMethodDescriptor(declRef);
825825
}
826+
auto *decl =
827+
llvm::dyn_cast_or_null<AbstractFunctionDecl>(declRef.getDecl());
828+
if (decl && decl->hasBody()) {
829+
Visitor.addFunction(declRef);
830+
}
826831
}
827832

828833
void addAssociatedType(AssociatedType associatedType) {

test/TBD/coroutine_accessors.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: %target-build-swift-dylib(%t/%target-library-name(thing)) \
2+
// RUN: %s \
3+
// RUN: -emit-tbd \
4+
// RUN: -Xfrontend -validate-tbd-against-ir=all \
5+
// RUN: -enable-library-evolution \
6+
// RUN: -Xfrontend -tbd-install_name -Xfrontend thing \
7+
// RUN: -emit-module \
8+
// RUN: -module-name thing \
9+
// RUN: -enable-experimental-feature CoroutineAccessors
10+
11+
// REQUIRES: swift_feature_CoroutineAccessors
12+
13+
public struct S {}
14+
15+
public protocol P {
16+
associatedtype A
17+
18+
var s: S { read set }
19+
}

0 commit comments

Comments
 (0)