Skip to content

Conversation

@slavapestov
Copy link
Contributor

No description provided.

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov slavapestov force-pushed the add-binding-cleanup-2 branch from 0afa1c0 to d30914d Compare February 9, 2026 23:21
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

The mock SDK didn't have the right overloads of CGRect.init().
…wer score

We drop all favored choices except for those with the best score. If we had
other favored choices with a lower score, they might still match, but
require a subtype conversion, perhaps.

Count these choices, and when comparing two disjunctions with the same
number of favored choices, prefer the one with fewer less favored choices,
all else being equal, before comparing the number of active choices.
@slavapestov slavapestov force-pushed the add-binding-cleanup-2 branch from 5fd6e57 to 7d63fe3 Compare February 10, 2026 18:26
@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

…zableConformance

Instead of SK_Unavailable.

This is so that test/Constraints/rdar139812024.swift will continue to
pass with an upcoming change. The problem was that in this test,
an unsound optimization meant that we would find a worse solution,
by not considering the better solution, according to our scoring
rules. The worse solution involved an unavailable conformance to
Sendable, while the better one used a missing synthesized one.

Note that this is only an issue in Swift 5 mode, where unavailable
Sendable conformance is a warning. Both are an error in Swift 6 mode,
so it doesn't matter which solution we pick there anyway.
We would sometimes replace a binding whose type contains type
variables with one that does not. This is unsound in the general
case, but we need to to avoid performance problems and ambiguous
solutions in certain pathological cases.

I found two test cases in the test suite that exercised this
specific behavior. Extract them into their own file, and generalize
at the test case. At the same time, tweak the hack to narrow it
down a bit.
These cases were using Exact incorrectly.
@slavapestov slavapestov force-pushed the add-binding-cleanup-2 branch from 7d63fe3 to d732d57 Compare February 11, 2026 13:15
@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

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.

1 participant