Skip to content

Commit e1e008c

Browse files
committed
Update taskgroup_cancelAll_from_child test to use new diagnostic
1 parent 8a3a5bb commit e1e008c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2556,8 +2556,8 @@ namespace {
25562556
if (auto param = dyn_cast<ParamDecl>(value)){
25572557
if(param->isInOut()){
25582558
ctx.Diags.diagnose(loc, diag::concurrent_access_of_inout_param, param->getName());
2559+
return true;
25592560
}
2560-
return true;
25612561
}
25622562

25632563
// Otherwise, we have concurrent access. Complain.

test/Concurrency/taskgroup_cancelAll_from_child.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ func test_taskGroup_cancelAll() async {
1313

1414
group.spawn {
1515
group.cancelAll() //expected-warning{{capture of 'group' with non-sendable type 'TaskGroup<Int>' in a `@Sendable` closure}}
16-
//expected-error@-1{{reference to captured parameter 'group' in concurrently-executing code}}
16+
//expected-error@-1{{mutable capture of 'inout' parameter 'group' is not allowed in concurrently-executing code}}
17+
1718
return 0
1819
}
1920
group.spawn { [group] in

0 commit comments

Comments
 (0)