Skip to content

Sema: Clean up CSApply for CGFloat <-> Double conversion #78957

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 4 commits into from
Jan 28, 2025

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Jan 27, 2025

An implementation limitation prevented us from allowing conversions between CGFloat? and Double?, even though CGFloat to Double? (and the other direction) was allowed. To make an upcoming performance improvement work, we have to allow these conversions, otherwise we can back ourselves into a corner and fail to find a solution in some cases.

This PR does not change any behavior, but it fixes the limitation that prevented us from allowing the optional-to-optional conversion here.

@slavapestov slavapestov force-pushed the cgfloat-double-cleanup branch 2 times, most recently from 683c4a0 to 0035420 Compare January 27, 2025 21:46
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

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

LGTM! If it's guaranteed to pick the same initializer overload for Double/CGFloat there is no point of trying to select it during solving.

@slavapestov slavapestov force-pushed the cgfloat-double-cleanup branch from 0035420 to 5cbe8cb Compare January 27, 2025 23:04
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov slavapestov merged commit 852e3f5 into swiftlang:main Jan 28, 2025
7 checks passed
slavapestov added a commit to slavapestov/swift that referenced this pull request Feb 14, 2025
After swiftlang#78957, there is no
technical reason to not allow this conversion. This is needed for
an upcoming optimization.
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.

2 participants