Skip to content

Conversation

@slavapestov
Copy link
Contributor

This fixes an ambiguity introduced by the stdlib change in 0f99458.

Since (borrowing T) -> () and (T) -> () both convert to each other, we could end up with ambiguous solutions where neither one was better than the other. Generalize the existing trick we use for labeled vs unlabeled tuples to also strip off ownership specifiers and @convention(...) from function types. This fixes the regression, as well an existing FIXME in a test I added a while ago where the same problem arises with @convention(block).

This fixes an ambiguity introduced by the stdlib change in
0f99458.

Since (borrowing T) -> () and (T) -> () both convert to
each other, we could end up with ambiguous solutions where
neither one was better than the other. Generalize the
existing trick we use for labeled vs unlabeled tuples to
also strip off ownership specifiers and @convention(...)
from function types. This fixes the regression, as well
an existing FIXME in a test I added a while ago where
the same problem arises with @convention(block).
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor Author

@swift-ci Please test macOS

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test macOS

@slavapestov slavapestov merged commit e7d2c16 into swiftlang:main Dec 10, 2025
4 of 6 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.

2 participants