-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Concurrency] Task.immediate returning Never error must not have throwing op #82372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Concurrency] Task.immediate returning Never error must not have throwing op #82372
Conversation
…wing operation rdar://153855920
@@ -46,7 +47,7 @@ extension Task where Failure == ${FAILURE_TYPE} { | |||
public static func startSynchronously( | |||
name: String? = nil, | |||
priority: TaskPriority? = nil, | |||
@_implicitSelfCapture @_inheritActorContext(always) _ operation: sending @isolated(any) @escaping () async throws -> Success | |||
@_implicitSelfCapture @_inheritActorContext(always) _ operation: sending @isolated(any) @escaping () async ${THROWS} -> Success |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method has hardcoded silgen name already
@@ -79,7 +80,7 @@ extension Task where Failure == ${FAILURE_TYPE} { | |||
public static func immediate( | |||
name: String? = nil, | |||
priority: TaskPriority? = nil, | |||
@_implicitSelfCapture @_inheritActorContext(always) operation: sending @isolated(any) @escaping () async throws -> Success | |||
@_implicitSelfCapture @_inheritActorContext(always) operation: sending @isolated(any) @escaping () async ${THROWS} -> Success |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method is AEIC
@@ -256,7 +257,7 @@ extension Task where Failure == ${FAILURE_TYPE} { | |||
@discardableResult | |||
public static func startOnMainActor( | |||
priority: TaskPriority? = nil, | |||
${OPERATION_PARAM} | |||
@_inheritActorContext @_implicitSelfCapture _ operation: __owned @Sendable @escaping @MainActor () async ${THROWS} -> Success |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same as OPERATION_PARAM but moved to the THROWS pattern we use elsewhere in this file
@swift-ci please smoke test |
@@ -1,5 +1,4 @@ | |||
// RUN: %target-build-swift -swift-version 6 %s -strict-concurrency=complete -Xfrontend -verify | |||
|
|||
// RUN: %target-swift-frontend -parse-as-library -swift-version 6 -strict-concurrency=complete -emit-sil -verify %s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I don't think -strict-concurrency=complete
is viable if -swift-version 6
is set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true, i'll fix that :)
@swift-ci please smoke test |
Ofc when we return an Never error, the operation cannot be throwing, this fixes that.
The API thankfully is AEIC, and the other place has silgenname already so we're safe from ABI trouble here.
rdar://153855920