Skip to content

[CSBindings] Delay binding chain result if type is an optional of a… #33740

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 1 commit into from
Sep 1, 2020

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Sep 1, 2020

… type variable

If subtyping is allowed for a result type of an implicit member chain,
let's delay binding it to an optional until its object type resolved too or
it has been determined that there is no possibility to resolve it.
Otherwise we might end up missing solutions since it's allowed to
implicitly unwrap base type but it can't be done early - type variable
representing chain's result type has a different l-valueness comparing
to generic parameter of an optional.

This used to work before due to a hack in constraint generator where
unresolved member with arguments would return base type (which
doesn't allow l-value) instead of a result type.

Resolves: rdar://problem/68094328

…ype variable

If subtyping is allowed for a result type of an implicit member chain,
let's delay binding it to an optional until its object type resolved too or
it has been determined that there is no possibility to resolve it.
Otherwise we might end up missing solutions since it's allowed to
implicitly unwrap base type but it can't be done early - type variable
representing chain's result type has a different l-valueness comparing
to generic parameter of an optional.

This used to work before due to a hack in constraint generator where
unresolved member with arguments would return base type (which
doesn't allow l-value) instead of a result type.

Resolves: rdar://problem/68094328
@xedin xedin requested review from DougGregor and hborla September 1, 2020 07:52
@xedin
Copy link
Contributor Author

xedin commented Sep 1, 2020

@swift-ci please smoke test

@xedin
Copy link
Contributor Author

xedin commented Sep 1, 2020

/cc @Jumhyn

@xedin
Copy link
Contributor Author

xedin commented Sep 1, 2020

@swift-ci please test source compatibility

@xedin xedin merged commit b7d5ea8 into swiftlang:master Sep 1, 2020
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