Skip to content

Conversation

@lorentey
Copy link
Member

@lorentey lorentey commented Sep 1, 2022

Add @_disfavoredOverload attributes to resolve edge-case ambiguities with overloads that only differ between tuple labels. In some situations, the compiler seems to be of two minds about whether (Key, Value) is compatible with (key: Key, value: Value) or vice versa.

@_disfavoredOverload is not a stable attribute; using it involves some risk in case future compilers remove it or change its behavior. In the worst case, we may have to publish a new release to fix such issues.

Resolves #125.

Checklist

  • I've read the Contribution Guidelines
  • My contributions are licensed under the Swift license.
  • I've followed the coding style of the rest of the project.
  • I've added tests covering all new code paths my change adds to the project (if appropriate).
  • I've added benchmarks covering new functionality (if appropriate).
  • I've verified that my change does not break any existing tests or introduce unexplained benchmark regressions.
  • I've updated the documentation if necessary.

@lorentey lorentey added this to the 1.0.3 milestone Sep 1, 2022
@lorentey lorentey linked an issue Sep 1, 2022 that may be closed by this pull request
2 tasks
@lorentey
Copy link
Member Author

lorentey commented Sep 1, 2022

@swift-ci test

@lorentey lorentey requested a review from glessard September 1, 2022 01:04
@lorentey lorentey merged commit 96c9d7a into apple:release/1.0 Sep 2, 2022
@lorentey lorentey deleted the fix-call-site-ambiguities branch September 2, 2022 00:14
Copy link
Contributor

@glessard glessard left a comment

Choose a reason for hiding this comment

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

Nice!

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.

Ambiguous initializers

2 participants