Skip to content

Fixes SR-642: Code completion does not instantiate generic arguments of a type wrapped in an optional. #1137

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 2 commits into from
Feb 4, 2016

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jan 29, 2016

No description provided.

@nkcsgexi
Copy link
Contributor

Could you add a test?

@@ -1708,7 +1708,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
Type ContextTy = VD->getDeclContext()->getDeclaredTypeOfContext();
if (ContextTy) {
Type MaybeNominalType = ExprType->getRValueInstanceType();
if (ContextTy->getAnyNominal() == MaybeNominalType->getAnyNominal() &&
if (ContextTy->getDesugaredType()->getAnyNominal() == MaybeNominalType->getDesugaredType()->getAnyNominal() &&
Copy link
Contributor

Choose a reason for hiding this comment

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

80 columns.

@gribozavr
Copy link
Contributor

... and it would be best if the test didn't use Set, but used a mock type instead. Set can change in future.

@ahoppen
Copy link
Member Author

ahoppen commented Jan 29, 2016

I added a test case and added a line break so that the lines are only 80-ish columns. Thanks for the hint with the mock type, wouldn’t have thought about that

let x: Foo<Bar>? = Foo<Bar>()
x.#^FOO_OPTIONAL_1^#
// FOO_OPTIONAL_1: Begin completions, 4 items
// FOO_OPTIONAL_1-DAG: ecl[InstanceMethod]/CurrNominal/Erase[1]: ?.myFunction({#(foobar): Bar#})[#Void#]; name=myFunction(foobar: Bar)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is awesome 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Decl?

@ahoppen
Copy link
Member Author

ahoppen commented Jan 30, 2016

Sorry, don't know how these changes happened between my tests and and the commit. Hope everything is fine now ;-)

@tkremenek
Copy link
Member

@swift-ci Please test

@tkremenek tkremenek self-assigned this Feb 4, 2016
@tkremenek tkremenek changed the title Fixed SR-642 Code completion does not instantiate concrete element type of optional Set Fixes SR-642: Code completion does not instantiate generic arguments of a type wrapped in an optional. Feb 4, 2016
tkremenek added a commit that referenced this pull request Feb 4, 2016
Fixes SR-642: Code completion does not instantiate generic arguments of a type wrapped in an optional.
@tkremenek tkremenek merged commit 7f77733 into swiftlang:master Feb 4, 2016
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.

5 participants