-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Conversation
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() && |
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.
80 columns.
... and it would be best if the test didn't use Set, but used a mock type instead. |
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) |
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.
This is awesome 👍
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.
Decl?
Sorry, don't know how these changes happened between my tests and and the commit. Hope everything is fine now ;-) |
@swift-ci Please test |
Fixes SR-642: Code completion does not instantiate generic arguments of a type wrapped in an optional.
No description provided.