-
Notifications
You must be signed in to change notification settings - Fork 295
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
Replaced Any
uses for workaround with Box
#2250
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54fd55b
to
25f544c
Compare
See swiftlang/swift#58099 This is fixed in newer versions of Xcode, but we still need the workaround for older ones. Instead of using `Any` and force-casting, `Box` is better since it's type safe. I've also updated the comments to point to the new `Swift` GitHub issue page.
25f544c
to
6306add
Compare
NachoSoto
commented
Jan 27, 2023
final class Box<T> { | ||
|
||
var value: T | ||
let value: T |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report
@@ Coverage Diff @@
## main #2250 +/- ##
==========================================
+ Coverage 85.90% 85.99% +0.09%
==========================================
Files 183 184 +1
Lines 12125 12127 +2
==========================================
+ Hits 10416 10429 +13
+ Misses 1709 1698 -11
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
tonidero
approved these changes
Feb 7, 2023
NachoSoto
pushed a commit
that referenced
this pull request
Feb 8, 2023
**This is an automatic release.** ### Dependency Updates * Bump fastlane-plugin-revenuecat_internal from `738f255` to `9255366` (#2264) via dependabot[bot] (@dependabot[bot]) * Update `Gemfile.lock` (#2254) via Cesar de la Vega (@vegaro) ### Other Changes * `HTTPClient`: added support for sending `X-Nonce` (#2214) via NachoSoto (@NachoSoto) * `Configuration`: added (`internal` for now) API to load public key (#2215) via NachoSoto (@NachoSoto) * Replaced `Any` uses for workaround with `Box` (#2250) via NachoSoto (@NachoSoto) * `HTTPClientTests`: fixed failing test with missing assertions (#2262) via NachoSoto (@NachoSoto) * `HTTPClientTests`: refactored tests to use `waitUntil` (#2257) via NachoSoto (@NachoSoto) * PurchaseTester: Add Receipt Inspector UI (#2249) via Andy Boedo (@aboedo) * Adds dependabot (#2259) via Cesar de la Vega (@vegaro) * `StoreKit1WrapperTests`: avoid using `Bool.random` to fix flaky code coverage (#2258) via NachoSoto (@NachoSoto) * `IntroEligibilityCalculator`: changed logic to handle products with no subscription group (#2247) via NachoSoto (@NachoSoto)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See swiftlang/swift#58099
This is fixed in newer versions of Xcode, but we still need the workaround for older ones. Instead of using
Any
and force-casting,Box
is better since it's type safe.Other changes:
Box
toRevenueCat
to be able to use the workaround there too.Box
immutable. It's very dangerous to have a reference value (Box
is aclass
) with reference semantics be mutable. Instead, we force users to have a mutable property instead and re-create theBox
, to avoid mutating that data under the hood.Swift
GitHub issue page.