Skip to content

Concurrency: fix inconsistent _asyncLet_get signatures #41487

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stdlib/public/Concurrency/AsyncLet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ public func _asyncLetEnd(
/// Wait if necessary and then project the result value of an async let
@available(SwiftStdlib 5.1, *)
@_silgen_name("swift_asyncLet_get")
public func _asyncLet_get(_ asyncLet: Builtin.RawPointer, _ resultBuffer: Builtin.RawPointer) async -> Builtin.RawPointer
public func _asyncLet_get(_ asyncLet: Builtin.RawPointer, _ resultBuffer: Builtin.RawPointer) async

/// Wait if necessary and then project the result value of an async let that throws
@available(SwiftStdlib 5.1, *)
@_silgen_name("swift_asyncLet_get_throwing")
public func _asyncLet_get_throwing(_ asyncLet: Builtin.RawPointer, _ resultBuffer: Builtin.RawPointer) async throws -> Builtin.RawPointer
public func _asyncLet_get_throwing(_ asyncLet: Builtin.RawPointer, _ resultBuffer: Builtin.RawPointer) async throws

/// Wait if necessary and then tear down the async let task
@available(SwiftStdlib 5.1, *)
Expand Down
4 changes: 4 additions & 0 deletions test/api-digester/stability-concurrency-abi.test
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ Func AsyncSequence.prefix(while:) is now with @preconcurrency
Func MainActor.run(resultType:body:) has generic signature change from <T where T : Swift.Sendable> to <T>
Func MainActor.run(resultType:body:) has mangled name changing from 'static Swift.MainActor.run<A where A: Swift.Sendable>(resultType: A.Type, body: @Swift.MainActor @Sendable () throws -> A) async throws -> A' to 'static Swift.MainActor.run<A>(resultType: A.Type, body: @Swift.MainActor @Sendable () throws -> A) async throws -> A'
Func _runAsyncMain(_:) is now with @preconcurrency
Func _asyncLet_get(_:_:) has mangled name changing from '_Concurrency._asyncLet_get(Builtin.RawPointer, Builtin.RawPointer) async -> Builtin.RawPointer' to '_Concurrency._asyncLet_get(Builtin.RawPointer, Builtin.RawPointer) async -> ()'
Func _asyncLet_get(_:_:) has return type change from Builtin.RawPointer to ()
Func _asyncLet_get_throwing(_:_:) has mangled name changing from '_Concurrency._asyncLet_get_throwing(Builtin.RawPointer, Builtin.RawPointer) async throws -> Builtin.RawPointer' to '_Concurrency._asyncLet_get_throwing(Builtin.RawPointer, Builtin.RawPointer) async throws -> ()'
Func _asyncLet_get_throwing(_:_:) has return type change from Builtin.RawPointer to ()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The declarations are annotated with _silgen_name, so the emitted symbols ought to remain the same even though the signature changed. Is this just a bug in the API digester that it flags it as an ABI change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems there was a patch to use mangled name instead of USR #39846 but reverted for some reason. cf. #39906 #39920 (comment)

@nkcsgexi Could you tell me the reason if possible?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. This change looks like it should be ABI-neutral as long as I'm not missing something.

Protocol Actor has added inherited protocol AnyActor
Protocol Actor has generic signature change from <Self : AnyObject, Self : Swift.Sendable> to <Self : _Concurrency.AnyActor>
Struct CheckedContinuation has removed conformance to UnsafeSendable
Expand Down