Skip to content

[Scope map] Miscellaneous improvements (and a hack) for unqualified name lookup #4770

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
Sep 15, 2016

Conversation

DougGregor
Copy link
Member

Introduces several fixes to match the way unqualified name lookup currently works (e.g., w.r.t. local computed properties), as well as improving bad source locations in the AST on ill-formed code.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

While the use of a local property from within its own accessors is a
bit dubious, Swift 3 only warned on it, so model the existing lookup
behavior in the scope map.
…L mode.

The integrated REPL does very funny things with source locations in
source files, because it uses new buffers for each bit of code it
parses, breaking all of the invariants of a source-based data
structure like ASTScope.
…ified name lookup.

When using the ASTScope-based unqualified name lookup, we might find
things that are in scope but haven't been fully type-checked yet;
allow us to perform type checking.
DeclContext::getSelfTypeInContext() returns null types in some cases
of broken protocols. Hack around this in the ASTScope-based
unqualified name lookup code for now, with a narrower hack than what
the existing unqualified name lookup is doing (which is even *less*
principled).
…ariables.

Until the point where ASTScope-based unqualified name lookup is the
default, unqualified name lookup can still find names declared *after*
the source location. The 'hasType' check no longer makes sense, so actually
check the source location of the entity we found.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@DougGregor
Copy link
Member Author

@swift-ci please smoke test Linux

@DougGregor DougGregor merged commit dd7ae44 into swiftlang:master Sep 15, 2016
@DougGregor DougGregor deleted the scope-map-fixes branch September 15, 2016 21:30
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