Skip to content

[CodeCompletion] Don't try to resolve generic env for extension in inactive block #20015

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
Oct 27, 2018

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Oct 24, 2018

Fixes code-completion crash in validateExtension().

When code completion happens, it tries to validate decl contexts. If it's in an extension in inactive conditional block, the extension haven't been bound to the nominal type. That used to cause crash because its GenericParams hasn't been set.

rdar://problem/45275782
https://bugs.swift.org/browse/SR-9001

@rintaro
Copy link
Member Author

rintaro commented Oct 24, 2018

@swift-ci Please smoke test

@@ -4973,6 +4973,13 @@ void TypeChecker::validateExtension(ExtensionDecl *ext) {
// Validate the nominal type declaration being extended.
validateDecl(nominal);

// If this is not bound to any decls at this point, this extension is in
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe move this to before the validateDecl() call

…active block

Fixes code-completion crash in validateExtension().

When code completion happens, it tries to validate decl contexts. If
it's in an extension in inactivec conditional block, the extension
haven't been bound to nominal type. That used to cause crash because its
GenericParams hasn't been set.

rdar://problem/45275782
https://bugs.swift.org/browse/SR-9001
@rintaro rintaro force-pushed the ide-completion-rdar45275782 branch from a747fc0 to 07172f4 Compare October 26, 2018 01:09
@rintaro
Copy link
Member Author

rintaro commented Oct 26, 2018

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Oct 27, 2018

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Oct 27, 2018

@swift-ci Please smoke test Linux platform

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