Skip to content

Unqualified lookup cleanup #10277

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 6 commits into from
Jun 16, 2017

Conversation

slavapestov
Copy link
Contributor

No description provided.

There's no need to walk up the parent contexts here.
resolveGenericTypeParamType(), resolveTypeOfDecl() and
resolveTypeOfContext() would all take the type of a
declaration, and optionally map it into context.

Replace them with a mapTypeIntoContext() that takes a
type and either returns it verbatim or maps it into
context.
When an unqualified reference is overloaded, we would walk
the list of overload candidates and check if they are all
member accesses. If they are, we would form an
UnresolvedMemberRefExpr with the right base. Otherwise,
we would form an UnresolvedDeclRefExpr.

Now, consider forming an UnresolvedMemberRefExpr even if
some of the members are types. This forces all nested
type lookups to go through getTypeOfMemberReference(),
not getTypeOfReference().

As a result, we no longer pass nested types to the
resolveTypeInContext() function from expression checking.

This will allow resolveTypeInContext() to take the base
declaration on which the nested type was found as a
parameter, instead of walking parent DeclContexts to
try to guess what the right base was.
@slavapestov slavapestov force-pushed the unqualified-lookup-cleanup branch from b1e0503 to 61b7eff Compare June 16, 2017 04:59
… to check type witnesses

Regression was introduced by
ec60c88.

I don't have a reduced test case, but this solves
<rdar://problem/32668454>.
@slavapestov slavapestov changed the title Unqualified lookup cleanup (WIP) Unqualified lookup cleanup Jun 16, 2017
@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

The source compat suite failed because vapor UPASS'd -- which is good!

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