mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
This commit is contained in:
@@ -3052,7 +3052,8 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
if (mayExecuteConcurrentlyWith(
|
||||
if (ctx.LangOpts.hasFeature(Feature::RegionBasedIsolation) &&
|
||||
mayExecuteConcurrentlyWith(
|
||||
localFunc.getAsDeclContext(), getDeclContext(),
|
||||
/*includeSending*/true)) {
|
||||
auto innermostGenericDC = localFunc.getAsDeclContext();
|
||||
|
||||
13
test/Concurrency/sendable_metatype_swift5.swift
Normal file
13
test/Concurrency/sendable_metatype_swift5.swift
Normal file
@@ -0,0 +1,13 @@
|
||||
// RUN: %target-typecheck-verify-swift -swift-version 5
|
||||
|
||||
// REQUIRES: concurrency
|
||||
|
||||
protocol P {
|
||||
static func doSomething()
|
||||
}
|
||||
|
||||
func doSomethingStatic<T: P>(_: T.Type) {
|
||||
Task { @concurrent in
|
||||
T.doSomething()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user