Skip to content

[ConstraintSystem] Modernization of key path application handling #70007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 28, 2023

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Nov 23, 2023

  • Make sure that key path subscript index and its element both have proper locators.
  • Add support for existential opening on key path subscript index
  • Drop TVO_CanBindToInOut from key path subscript index which is never the case
  • Detect and diagnose invalid arguments for key path subscript
    • Introduces a new diagnostic for the situations when argument is not a valid key path type.

xedin added 10 commits November 17, 2023 13:21
…out`

Subscripts do not support inout parameters.
…ariable

The resulting type is no longer in use so there is no need to create
a type variable and a constraint to perform the operation.
…iable

Previous `FunctionArgument` locator didn't make sense because
this type variable doesn't actually represent a parameter but
rather a value generic parameter of the key path subscript index
parameter.
…diagnostic mode

This parameter doesn't allow direct holes because it always replies
on the contextual type (if it's not present the hole should be
propagated to it), so if we know that the argument is some invalid
existential value (one without a superclass) let's allow binding to
it only in diagnostic mode which would be detected and diagnosed as
a contextual mismatch.
@xedin
Copy link
Contributor Author

xedin commented Nov 23, 2023

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Nov 23, 2023

@swift-ci please test source compatibility

@xedin
Copy link
Contributor Author

xedin commented Nov 27, 2023

@swift-ci please smoke test macOS platform

3 similar comments
@xedin
Copy link
Contributor Author

xedin commented Nov 27, 2023

@swift-ci please smoke test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Nov 28, 2023

@swift-ci please smoke test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Nov 28, 2023

@swift-ci please smoke test macOS platform

@xedin xedin merged commit bd4ee46 into swiftlang:main Nov 28, 2023
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