Skip to content

Commit 1a3ce94

Browse files
committed
Only emit the non-sendable metatype capture diagnostic under region-based isolation
We effectively suppress sendable diagnostics when region-based isolation is disabled, and RBI is enabled whenever strict concurrency checking is enabled. So, suppress this diagnostic when RBI is enabled. Fixes rdar://152583759.
1 parent c1358c5 commit 1a3ce94

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3068,7 +3068,8 @@ namespace {
30683068
}
30693069
}
30703070

3071-
if (mayExecuteConcurrentlyWith(
3071+
if (ctx.LangOpts.hasFeature(Feature::RegionBasedIsolation) &&
3072+
mayExecuteConcurrentlyWith(
30723073
localFunc.getAsDeclContext(), getDeclContext(),
30733074
/*includeSending*/true)) {
30743075
auto innermostGenericDC = localFunc.getAsDeclContext();
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: %target-typecheck-verify-swift -swift-version 5
2+
3+
// REQUIRES: concurrency
4+
5+
protocol P {
6+
static func doSomething()
7+
}
8+
9+
func doSomethingStatic<T: P>(_: T.Type) {
10+
Task { @concurrent in
11+
T.doSomething()
12+
}
13+
}

0 commit comments

Comments
 (0)