Skip to content

Conversation

@robmaceachern
Copy link
Member

Swift 5.9 introduced a new warning related to object conversions to UnsafeRawPointer.

image

This updates the key type on associated object invocations to be a UInt8 which avoids the warning.

Checklist

  • Unit Tests
  • UI Tests
  • Snapshot Tests (iOS only)
  • I have made corresponding changes to the documentation

@CLAassistant
Copy link

CLAassistant commented Aug 29, 2023

CLA assistant check
All committers have signed the CLA.

@robmaceachern robmaceachern marked this pull request as ready for review August 29, 2023 21:35
@robmaceachern robmaceachern requested a review from a team as a code owner August 29, 2023 21:35
Copy link
Contributor

@square-tomb square-tomb left a comment

Choose a reason for hiding this comment

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

I take it that the keys can have any value type (and any initial value) to avoid this warning, and that UInt8 and 0 are chosen here just because the former is small?

@robmaceachern
Copy link
Member Author

I take it that the keys can have any value type (and any initial value) to avoid this warning, and that UInt8 and 0 are chosen here just because the former is small?

Yeah exactly. The value is meaningless but UInt8 is used to save a bit of memory.

@robmaceachern robmaceachern merged commit 4dfe312 into main Aug 30, 2023
@robmaceachern robmaceachern deleted the robmaceachern/swift-5-9-warning-fix branch August 30, 2023 15:40
square-tomb added a commit that referenced this pull request Nov 4, 2023
…ftui-testbed

* 'main' of github.com:square/workflow-swift:
  Add WorkflowSwiftUIExperimental  (#252)
  Add convenience method for library definitions to reduce boilerplate (#251)
  [release]: bump to version 3.4.0 (#250)
  RxSwift 6.6 (#212)
  Expose 'screen' on WorkflowHostingController (#246)
  [fix]: address some RenderTester limitations with optionals (#245)
  Resolved Swift 5.9 compilation warning related to UnsafeRawPointer object conversion (#243)
  Bump activesupport from 6.1.7.3 to 6.1.7.6 (#242)
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

Successfully merging this pull request may close these issues.

5 participants