-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labelsThis issue needs more specific labels
Description
Description
The error message in the following code is incorrect. The closure in test() runs in an isolated domain of A instance, but the diagnostic says it's nonisolated.
actor A {
var value = 0
}
actor B {
var value = 0
func test() {
let _: (isolated A) -> Void = { a in
a.value = 1 // OK
self.value = 1 // error: actor-isolated property 'value' can not be mutated from a nonisolated context
}
}
}
Reproduction
See above
Expected behavior
The diagnostic should be something like:
actor-isolated property 'value' can not be mutated from a different actor-isolated context
Environment
I use swiftc nightly build on godbolt, with -swift-version 6 setting.
Additional information
No response
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labelsThis issue needs more specific labels