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
I tried to use URLRouting in a Swift 6 environment and soon get concurrency errors.
For example: The Router types seem not to be sendable. If you try to define one you get the following error:
letappRouter=OneOf{
// GET /books
Route(.case(AppRoute.books)){Path{"books"}}
// GET /books/:id
Route(.case(AppRoute.book(id:))){Path{"books"; Digits()}}}
Stored property 'appRouter' of 'Sendable'-conforming struct 'InventoryResponder' has non-sendable type 'OneOf<URLRequestData, AppRoute, OneOfBuilder<URLRequestData, AppRoute>.OneOf2<Route<Parsers.MapConversion<Path<PathBuilder.Component>, AnyCasePath<AppRoute, ()>>>, Route<Parsers.MapConversion<Path<PathBuilder.PathZipVO<String, Digits<PartialRangeFrom, Conversions.SubstringToUTF8View>>>, AnyCasePath<AppRoute, Int>>>>>'
What is the right way do do this or is the library only usable with @preconcurrency import URLRouting ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I tried to use URLRouting in a Swift 6 environment and soon get concurrency errors.
For example: The Router types seem not to be sendable. If you try to define one you get the following error:
What is the right way do do this or is the library only usable with
@preconcurrency import URLRouting
?Beta Was this translation helpful? Give feedback.
All reactions