Skip to content

Commit 75f4fb1

Browse files
committed
Mark async let closures as @Concurrent.
This ensures that they enable concurrency-related checks.
1 parent 9efb44f commit 75f4fb1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/Sema/CSApply.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -7835,6 +7835,7 @@ static Expr *wrapAsyncLetInitializer(
78357835
bool throws = TypeChecker::canThrow(initializer);
78367836
auto extInfo = ASTExtInfoBuilder()
78377837
.withAsync()
7838+
.withConcurrent()
78387839
.withThrows(throws)
78397840
.build();
78407841

test/SILGen/async_let.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ enum SomeError: Error {
1616
// CHECK-LABEL: sil hidden [ossa] @$s4test0A11AsyncLetIntSiyYF : $@convention(thin) @async () -> Int
1717
func testAsyncLetInt() async -> Int {
1818
// CHECK: [[I:%.*]] = mark_uninitialized [var] %0
19-
// CHECK: [[CLOSURE:%.*]] = function_ref @$s4test0A11AsyncLetIntSiyYFSiyYcfu_ : $@convention(thin) @async () -> Int
19+
// CHECK: [[CLOSURE:%.*]] = function_ref @$s4test0A11AsyncLetIntSiyYFSiyYJcfu_ : $@convention(thin) @async () -> Int
2020
// CHECK: [[THICK_CLOSURE:%.*]] = thin_to_thick_function [[CLOSURE]] : $@convention(thin) @async () -> Int to $@async @callee_guaranteed () -> Int
2121
// CHECK: [[REABSTRACT_THUNK:%.*]] = function_ref @$sSiIegHd_Sis5Error_pIegHrzo_TR : $@convention(thin) @async (@guaranteed @async @callee_guaranteed () -> Int) -> (@out Int, @error Error)
2222
// CHECK: [[REABSTRACT_CLOSURE:%.*]] = partial_apply [callee_guaranteed] [[REABSTRACT_THUNK]]([[THICK_CLOSURE]]) : $@convention(thin) @async (@guaranteed @async @callee_guaranteed () -> Int) -> (@out Int, @error Error)

0 commit comments

Comments
 (0)