Skip to content

Conversation

@xedin
Copy link
Contributor

@xedin xedin commented Dec 16, 2025

For TVO_PrefersSubtypeBinding type variables bindings are
sorted to make sure that non-subtype/equal bindings are attempted
last, so if any subtype or equality bindings produced a solution,
checking could be stopped since supertype bindings are always
considered to be worse.

This helps with cases like @Sendable () -> Void <: $T <: () -> Void or
KeyPath<...> & Sendable <: $T <: KeyPath<...> among others.

Resolves: rdar://125948508
Resolves: rdar://136315240

…)` early

Update `matchFunctionRepresentations` to reject convesions from
Swift to `convention(c)` function types for everything but closures
and declaration references. Closures and declaration references are
allowed because their eligibility depends on captures which might
not be ready during solving.
…d solution(s) with a subtype binding

For `TVO_PrefersSubtypeBinding` type variables bindings are
sorted to make sure that non-subtype/equal bindings are attempted
last, so if any subtype or equality bindings produced a solution,
checking could be stopped since supertype bindings are always
considered to be worse.

Resolves: rdar://125948508
Resolves: rdar://136315240
@xedin
Copy link
Contributor Author

xedin commented Dec 16, 2025

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Dec 16, 2025

@swift-ci please test source compatibility

@xedin
Copy link
Contributor Author

xedin commented Dec 17, 2025

@swift-ci please test Linux platform

@xedin
Copy link
Contributor Author

xedin commented Dec 17, 2025

swiftlang/llvm-project#12020
@swift-ci please test

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