Skip to content

Conversation

@clackary
Copy link

@clackary clackary commented Nov 21, 2025

Adds a test case and a fix to CSOptimizer, regarding a fast path with Any parameters that recently landed (c46f9e4). This change introduced a regression where it would cause (T.Type) -> (Any) disjunctions to outrank (T.Type) -> (Any.Type).

Refines the check to also favor existential metatype candidates.

Resolves: #85020
Resolves: rdar://163074598

@clackary clackary self-assigned this Nov 21, 2025
@clackary
Copy link
Author

@swift-ci please test

@clackary clackary force-pushed the fix/85020-metatype-resolution branch from 31150c4 to 34a211d Compare November 21, 2025 18:51
@clackary
Copy link
Author

@swift-ci please test

@clackary clackary force-pushed the fix/85020-metatype-resolution branch from 34a211d to a405fff Compare November 22, 2025 01:35
@clackary clackary changed the title [CSOptimizer] Exclude existential metatype candidates from paramType->isAny fast path [CSOptimizer] Also favor existential metatype candidates in paramType isAny fast path Nov 22, 2025
@clackary
Copy link
Author

@swift-ci please test

@xedin
Copy link
Contributor

xedin commented Nov 22, 2025

Thank you!

@xedin
Copy link
Contributor

xedin commented Nov 22, 2025

Let's cherry-pick this to 6.3 as well.

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.

Overload resolution picks wrong initializer for some metatype arguments

2 participants