Skip to content

Commit bc028dc

Browse files
committed
bin compat of .value accessor a bit confusing; shouldnt the typed throw be mangled differently?
1 parent ebc3d23 commit bc028dc

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -167,24 +167,17 @@ extension Task {
167167
///
168168
/// - Returns: The task's result.
169169
public var value: Success {
170+
// FIXME: This seems wrong that abi test is not freaking out here?
171+
// At the same time, adding a silgen_name compat accessor with old signature results in duplicate definitions -- is mangling of typed throws not done properly on return position?
170172
get async throws(Failure) {
171173
do {
172-
return try await __abi_value
174+
return try await _taskFutureGetThrowing(_task)
173175
} catch {
174176
throw error as! Failure
175177
}
176178
}
177179
}
178180

179-
@available(SwiftStdlib 5.1, *)
180-
@_silgen_name("$sScT5valuexvg")
181-
@usableFromInline
182-
internal var __abi_value: Success {
183-
get async throws {
184-
return try await _taskFutureGetThrowing(_task)
185-
}
186-
}
187-
188181
/// The result or error from a throwing task, after it completes.
189182
///
190183
/// If the task hasn't completed,
@@ -200,7 +193,7 @@ extension Task {
200193
public var result: Result<Success, Failure> {
201194
get async {
202195
do {
203-
return .success(try await __abi_value)
196+
return .success(try await value)
204197
} catch {
205198
return .failure(error as! Failure) // as!-safe, guaranteed to be Failure
206199
}

0 commit comments

Comments
 (0)