Skip to content

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Sep 22, 2020

Solver needs to handle invalid declarations but only in
"code completion" mode since declaration in question might
not be associated with code completion, otherwise (if constraint
generation fails) there is going to be no completion results.

In order to make this work we need to:

  • Extend HoleType to allow it to be originated from VarDecl;
  • Add a special flag to constraint system which specifies that solving is for "code completion";
  • Use special access for VarDecl types which respects constraint system flags
    and can convert any ErrorTypes into HoleTypess.

Associating holes directly with declarations is useful in
cases when declarations are invalid e.g. directly `ErrorType`
or have error types inside.
Solver needs to handle invalid declarations but only in
"code completion" mode since declaration in question might
not be associated with code completion, otherwise (if constraint
generation fails) there is going to be no completion results.
@xedin xedin requested review from hborla and nathawes September 22, 2020 23:31
@xedin
Copy link
Contributor Author

xedin commented Sep 23, 2020

@swift-ci please smoke test

@xedin
Copy link
Contributor Author

xedin commented Sep 23, 2020

@swift-ci please smoke test Windows platform

@xedin xedin changed the base branch from master to main September 23, 2020 18:26
Copy link
Member

@hborla hborla left a comment

Choose a reason for hiding this comment

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

One small comment/question about the property wrapper case, but otherwise LGTM!

@xedin xedin merged commit c946c80 into swiftlang:main Sep 23, 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.

3 participants