-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
@discardableResult
stops working when function is isolated to a global actor.
Reproducible in Swift 5 and Swift 6 modes. Does not reproduce when functions are isolated to an actor instance.
Reproduction
// Order of attributes does not matter
// Removing isolation attribute fixes the error
@discardableResult @MainActor
func foo() -> () -> Void {
return {}
}
@MainActor
func test() {
foo() // error: function is unused
}
Expected behavior
Code should compiler without error
Environment
swift-driver version: 1.120.5 Apple Swift version 6.1.2 (swiftlang-6.1.2.1.2 clang-1700.0.13.5)
Target: arm64-apple-macosx15.0
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