-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler error subclassing RouteOptions — required initializer must be provided by subclass #684
Comments
Facing the same issue here. When can we get an update for this? |
I have the same issue after updating the POD from MapboxDirections (2.3.0) to 2.4.0. |
We are going to make patch releases for Navigation SDKs early next week. |
We’re in a catch-22 because we caught this issue late enough that some downstream packages, including MapboxCoreNavigation v2.4.0, already depend on the initializer signature in MapboxDirections v2.4.0. There’s no way to make the class simultaneously compatible with subclasses expecting either signature. Whether we maintain the current behavior or revert to the previous behavior, we’ll break compatibility with the NavigationRouteOptions and NavigationMatchOptions implementations in one set of versions or another. To try to make the situation as painless as possible, all things considered, we’ll issue patch releases of MapboxCoreNavigation v2.1.x, v2.2.x, and v2.3.x that require MapboxDirections v2.4.0 instead of older versions. These MapboxCoreNavigation releases are being prepared in mapbox/mapbox-navigation-ios#3849, mapbox/mapbox-navigation-ios#3848, and mapbox/mapbox-navigation-ios#3846. Unfortunately, if you’ve defined your own direct subclass of RouteOptions or MatchOptions, we’re unable to ensure backwards compatibility with that subclass once you upgrade to MapboxDirections v2.4.0. You’ll need to update your override of public required init(waypoints: [Waypoint], profileIdentifier: ProfileIdentifier? = .automobileAvoidingTraffic, queryItems: [URLQueryItem]? = nil) Xcode will offer a fix-it suggestion for this new signature. Going forward, we’ve taken steps to make sure we catch similar backwards compatibility issues before they make it into a final release of MapboxDirections. |
#655 changed the
RouteOptions(waypoints:profileIdentifier:)
initializer to take an additionalqueryItems
parameter. Even though a default argument was provided, a subclass such as the navigation SDK’s NavigationRouteOptions would become incompatible and fail to build (albeit with a fix-it suggestion) because the signature differs:This change probably got missed in code review because it was marked
public
rather thanopen
, but it isrequired
nonetheless. It would’ve been caught by an API diffing tool: #683.Can we get around this issue by adding a convenience initializer with the old set of arguments, or do we need to revisit #655 (comment)? Either way, we need to issue the fix in v2.4.1 per semver rules.
/cc @mapbox/navigation-ios
The text was updated successfully, but these errors were encountered: