Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Change static var stored properties to static let #190

Merged
merged 1 commit into from
Aug 11, 2024

Conversation

fumoboy007
Copy link
Contributor

As far as I can tell, these stored properties are not meant to be changed. Therefore, change them to be immutable. This change also makes these static properties concurrency-safe.

As far as I can tell, these stored properties are not meant to be changed. Therefore, change them to be immutable. This change also makes these static properties concurrency-safe.
@ZachNagengast
Copy link
Contributor

Interesting, did you have a specifc use case where this was helping with thread safety for you? Or just a general improvement?

@fumoboy007
Copy link
Contributor Author

fumoboy007 commented Aug 7, 2024

Without this change, these properties won’t be usable due to the stricter Swift 6 compiler:

error: reference to static property '…' is not concurrency-safe because it involves shared mutable state

Copy link
Contributor

@ZachNagengast ZachNagengast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the context, looks ok to merge.

@ZachNagengast ZachNagengast merged commit 59aaa4e into argmaxinc:main Aug 11, 2024
15 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants