File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -411,6 +411,11 @@ SWIFT_CC(swift)
411411static bool swift_task_hasTaskGroupStatusRecordImpl() {
412412 auto task = swift_task_getCurrent ();
413413
414+ // a group must be in a task, so if we're not in a task...
415+ // then, we certainly are not in a group either!
416+ if (!task)
417+ return false ;
418+
414419 Optional<StatusRecordLockRecord> recordLockRecord;
415420
416421 // Acquire the status record lock.
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ func printTaskLocal<V>(
3333// ==== ------------------------------------------------------------------------
3434
3535@available ( SwiftStdlib 5 . 5 , * )
36- func synchronous_bind( ) async {
36+ func synchronous_bind( ) {
3737
3838 func synchronous( ) {
3939 printTaskLocal ( TL . $number) // CHECK: TaskLocal<Int>(defaultValue: 0) (1111)
@@ -45,14 +45,14 @@ func synchronous_bind() async {
4545 printTaskLocal ( TL . $number) // CHECK: TaskLocal<Int>(defaultValue: 0) (1111)
4646 }
4747
48- await TL . $number. withValue ( 1111 ) {
48+ TL . $number. withValue ( 1111 ) {
4949 synchronous ( )
5050 }
5151}
5252
5353@available ( SwiftStdlib 5 . 5 , * )
5454@main struct Main {
55- static func main( ) async {
56- await synchronous_bind ( )
55+ static func main( ) {
56+ synchronous_bind ( )
5757 }
5858}
You can’t perform that action at this time.
0 commit comments