Restore rethrows on toPresentedOverrides#6419
Conversation
The function was changed from `rethrows` to `throws` in #6285, but the new filtering logic (`filter`, `allSatisfy`) doesn't throw independently of the `convert` closure. Using `rethrows` avoids forcing unnecessary `try` at call sites that pass non-throwing closures. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Since `toPresentedOverrides` is now `rethrows`, call sites passing non-throwing closures no longer need `try`. Fixes pod lib lint warnings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolve conflicts: use the new convenience overload (no convert closure) without `try` for non-throwing call sites, keep `try` for Video's throwing closure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ializer The `LocalizedVideoPartial.create(from:using:)` method was removed on main. Use the direct initializer instead, which doesn't throw, allowing the Video init and its call site to drop `throws`/`try`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| self.pageStackViewModels = pageStackViewModels | ||
|
|
||
| self.presentedOverrides = try self.component.overrides?.toPresentedOverrides(discardRules: discardRules) | ||
| self.presentedOverrides = self.component.overrides?.toPresentedOverrides(discardRules: discardRules) |
There was a problem hiding this comment.
Several inits remain throws with no throwing operations
Low Severity
After removing try from the toPresentedOverrides calls, the init methods of CarouselComponentViewModel, IconComponentViewModel, StackComponentViewModel, TabsComponentViewModel, TimelineComponentViewModel, and TimelineItemViewModel are still marked throws but no longer contain any throwing operations. VideoComponentViewModel.init was correctly updated to non-throwing, but the same cleanup was missed for these other view models. This forces all callers to use try unnecessarily.
Additional Locations (2)
Follow-up to #6419: now that `toPresentedOverrides` identity overload is non-throwing, several view model inits no longer contain throwing operations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>


Summary
rethrows(instead ofthrows) ontoPresentedOverridesinPresentedPartials.swiftrethrowstothrowsin [Rules] Introduce rule system #6285, but the new filtering logic (filter,allSatisfy) doesn't throw independently of theconvertclosureTest plan
swift buildpasses🤖 Generated with Claude Code
Note
Low Risk
Low risk: this is a type-signature/compile-time error-propagation cleanup with no change to runtime override filtering or evaluation logic.
Overview
Restores
rethrowsonArray.toPresentedOverridesso it only throws when the providedconvertclosure throws, and makes the identity overload non-throwing.Updates several Paywalls V2 component view models to stop using
trywhen building presented overrides, and makesVideoComponentViewModelinitialization non-throwing (including removingtryat its factory call site).Written by Cursor Bugbot for commit 60dd66b. This will update automatically on new commits. Configure here.