Skip to content
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

Build warnings in SDK 5.1.0 with Xcode 12 beta 6 #220

Closed
idrougge opened this issue Aug 31, 2020 · 2 comments
Closed

Build warnings in SDK 5.1.0 with Xcode 12 beta 6 #220

idrougge opened this issue Aug 31, 2020 · 2 comments

Comments

@idrougge
Copy link

idrougge commented Aug 31, 2020

Describe the bug
DiagnosticEvent.swift has four warnings saying:

Immutable property will not be decoded because it is declared with an initial value which cannot be overwritten

SDK version
5.1.0

Language version, developer tools
Xcode 12, beta 6

@torchhound
Copy link
Contributor

torchhound commented Aug 31, 2020

Hi @idrougge, thanks for reporting this bug.

Tracked internally as 88282.

ericlewis added a commit to ericlewis/ios-client-sdk that referenced this issue Oct 8, 2020
This PR fixes the warnings mentioned in launchdarkly#220, which were added to the Swift compiler [somewhat recently](swiftlang/swift#30218). The cause of the warning is setting default values for a Decodable objects properties. This causes subtle bugs where a given property may not be correctly decoded.

The solution proposed here is one of a few, simply settings the variable to a `var` while making its setter private. This retains the original behavior for those consuming the code, while also allowing Decodable to work properly.
@ericlewis ericlewis mentioned this issue Oct 8, 2020
3 tasks
@gwhelanLD
Copy link
Contributor

Fixed in the 5.2.0 release. Thanks again for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants