Skip to content

[6.1][CSSimplify] CGFloat-Double: Fix ambiguity when assigning CGFloat to … #78547

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

Merged
merged 1 commit into from
Jan 11, 2025

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jan 10, 2025

…double property/variable

Cherry-pick of #77592


  • Explanation:

    Rectifying the fact that this didn't make it to 6.1 even though it should have.

    Situations like:

      let _: Double = <<CGFloat>>
      <var/property of type Double> = <<CGFloat>>
    

    Used to be supported due to an incorrect fix added in diagnostic mode.

    Lower impact here means that right-hand side of the assignment is allowed
    to maintain CGFloat until the very end which minimizes the number of
    conversions used and keeps literals as Double when possible.

  • Main Branch PR: [CSSimplify] CGFloat-Double: Fix ambiguity when assigning CGFloat to … #77592

  • Resolves: rdar://139675914

  • Risk: Low (the change is limited to assignments and affects only widening operators).

  • Reviewed By: @hborla

  • Testing: Added new tests to the Sema test suite.

(cherry picked from commit 7c35c88)

…double property/variable

Situations like:
```
  let _: Double = <<CGFloat>>
  <var/property of type Double> = <<CGFloat>>
```

Used to be supported due to an incorrect fix added in
diagnostic mode. Lower impact here means that right-hand
side of the assignment is allowed to maintain CGFloat
until the very end which minimizes the number of conversions
used and keeps literals as Double when possible.

Resolves: rdar://139675914
(cherry picked from commit 7c35c88)
@xedin xedin requested a review from hborla January 10, 2025 17:23
@xedin xedin requested a review from a team as a code owner January 10, 2025 17:23
@xedin
Copy link
Contributor Author

xedin commented Jan 10, 2025

@swift-ci please test

@xedin xedin requested a review from DougGregor January 10, 2025 17:43
@xedin xedin merged commit 5c6128f into swiftlang:release/6.1 Jan 11, 2025
5 checks passed
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.

3 participants