File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -478,20 +478,21 @@ public func _runAsyncHandler(operation: @escaping () async -> ()) {
478478 ///
479479 /// This function does _not_ block the underlying thread.
480480 public static func sleep( _ duration: UInt64 ) async {
481-
482481 // Set up the job flags for a new task.
483482 var flags = JobFlags ( )
484483 flags. kind = . task
485484 flags. priority = . default
486485 flags. isFuture = true
487486
488487 // Create the asynchronous task future.
489- let ( task, _) = Builtin . createAsyncTaskFuture ( flags. bits, nil , { } )
488+ // FIXME: This should be an empty closure instead. Returning `0` here is
489+ // a workaround for rdar://74957357
490+ let ( task, _) = Builtin . createAsyncTaskFuture ( flags. bits, nil , { return 0 } )
490491
491492 // Enqueue the resulting job.
492493 _enqueueJobGlobalWithDelay ( duration, Builtin . convertTaskToJob ( task) )
493494
494- let _ = await Handle < Void , Never > ( task) . get ( )
495+ let _ = await Handle < Int , Never > ( task) . get ( )
495496 }
496497// ==== UnsafeCurrentTask ------------------------------------------------------
497498
You can’t perform that action at this time.
0 commit comments