-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[NameLookup] Fix opaque decl astscope #27743
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
[NameLookup] Fix opaque decl astscope #27743
Conversation
|
@swift-ci please test |
…ve clause environment.
15d613b to
2e8920b
Compare
|
@swift-ci please test |
|
Build failed |
|
Build failed |
| << sourceFile->getFilename() << "\n"; | ||
| // The check is costly, and inactive lookups will end up here, so don't | ||
| // do the check unless we can't find the startingScope. | ||
| const bool isInInactiveClause = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t understand why we need this part, of the parser isn’t going to add these decls in the first place for inactive regions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tx for looking this over.
The idea is that lookups to things in inactive clauses may creep back in at some point. If they do, this part will output a more specific message for debugging, and also, as per your preference, will crash the compilation. It only runs when the ASTScope code cannot find the starting scope anyway, so it doesn't slow down compilation unless there's an error.
When someday, we rip out all the code that passed DeclContexts into UnqualifiedLookup, the whole did-not-find starting scope stuff will get ripped out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay!
|
As per offline conversation with @DougGregor , am proceeding to merge. |
|
Likely fixes rdar://56334618 |
Do not try to do lookups on OpaqueDecls that are in inactive clauses.
Also, fail the compilation for any lookups into inactive clauses.