You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
food.isNutritious= isNutritious // ❌ ERROR: trying to capture state here
81
-
Customer.current.eat(food)
82
-
}
83
-
}
84
-
```
70
+
<!-- TODO: discuss @MainActor isolation or lack thereof -->
85
71
86
72
If the body returns before the child process exits, the process exits as if
87
73
`main()` returned normally. If the body throws an error, Swift handles it as if
@@ -106,6 +92,59 @@ status of the child process against the expected exit condition you passed. If
106
92
they match, the exit test passes; otherwise, it fails and the testing library
107
93
records an issue.
108
94
95
+
### Capture state from the parent process
96
+
97
+
To pass information from the parent process to the child process, you specify
98
+
the Swift values you want to pass in a [capture list](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/closures/#Capturing-Values)
0 commit comments