mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
A @_distributedActorIndependent declaration is nonisolated.
The `@__distributedActorIndependent` attribute is effectively the same as nonisolated, so start treating it that way by making actor-isolation checking look for it specifically and conclude "nonisolated". Remove various special cases for this attribute that don't need to exist.
This commit is contained in:
@@ -67,24 +67,24 @@ distributed actor DistributedActor_1 {
|
||||
fatalError()
|
||||
}
|
||||
|
||||
distributed func distReturnGeneric<T: Codable>(item: T) async throws -> T { // ok
|
||||
distributed func distReturnGeneric<T: Codable & Sendable>(item: T) async throws -> T { // ok
|
||||
item
|
||||
}
|
||||
distributed func distReturnGenericWhere<T>(item: Int) async throws -> T where T: Codable { // ok
|
||||
distributed func distReturnGenericWhere<T: Sendable>(item: Int) async throws -> T where T: Codable { // ok
|
||||
fatalError()
|
||||
}
|
||||
distributed func distBadReturnGeneric<T>(int: Int) async throws -> T {
|
||||
distributed func distBadReturnGeneric<T: Sendable>(int: Int) async throws -> T {
|
||||
// expected-error@-1 {{distributed function result type 'T' does not conform to 'Codable'}}
|
||||
fatalError()
|
||||
}
|
||||
|
||||
distributed func distGenericParam<T: Codable>(value: T) async throws { // ok
|
||||
distributed func distGenericParam<T: Codable & Sendable>(value: T) async throws { // ok
|
||||
fatalError()
|
||||
}
|
||||
distributed func distGenericParamWhere<T>(value: T) async throws -> T where T: Codable { // ok
|
||||
distributed func distGenericParamWhere<T: Sendable>(value: T) async throws -> T where T: Codable { // ok
|
||||
value
|
||||
}
|
||||
distributed func distBadGenericParam<T>(int: T) async throws {
|
||||
distributed func distBadGenericParam<T: Sendable>(int: T) async throws {
|
||||
// expected-error@-1 {{distributed function parameter 'int' of type 'T' does not conform to 'Codable'}}
|
||||
fatalError()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user