Skip to content

Commit a9e6efb

Browse files
committed
[TBDGen] Use default kind for AFPAST SILDeclRef.
When adding an AsyncFunctionPointer to the TBD, a LinkEntity of kind AsyncFunctionPointerAST is constructed containing the decl. That decl is then wrapped in a SILDeclRef which is then mangled. Previously, the kind of the SILDeclRef was erroneously forced to be Func. The result was a failure to mangle the TBD symbol for async constructors correctly. Here, that argument is omitted so that the kind can be determined appropriately by SILDeclRef's constructor. rdar://80485869
1 parent 910d918 commit a9e6efb

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/IRGen/Linking.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,7 @@ std::string LinkEntity::mangleAsString() const {
468468

469469
case Kind::AsyncFunctionPointerAST: {
470470
std::string Result;
471-
Result =
472-
SILDeclRef(const_cast<ValueDecl *>(getDecl()), SILDeclRef::Kind::Func)
473-
.mangle();
471+
Result = SILDeclRef(const_cast<ValueDecl *>(getDecl())).mangle();
474472
Result.append("Tu");
475473
return Result;
476474
}

test/TBD/rdar80485869.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-frontend %s -emit-module-path %t/module -emit-tbd -enable-testing
3+
4+
public actor Tom {
5+
init() async {
6+
}
7+
}

0 commit comments

Comments
 (0)