Skip to content

Commit 352f392

Browse files
authored
Merge pull request #81983 from DougGregor/non-sendable-metatype-suppress
Only emit the non-sendable metatype capture diagnostic under region-based isolation
2 parents ecad1d9 + 332151a commit 352f392

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
@@ -3052,7 +3052,8 @@ namespace {
30523052
}
30533053
}
30543054

3055-
if (mayExecuteConcurrentlyWith(
3055+
if (ctx.LangOpts.hasFeature(Feature::RegionBasedIsolation) &&
3056+
mayExecuteConcurrentlyWith(
30563057
localFunc.getAsDeclContext(), getDeclContext(),
30573058
/*includeSending*/true)) {
30583059
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)