Skip to content

[SR-7670] Duplicate generic param completions in member decls #50210

@AnthonyLatsis

Description

@AnthonyLatsis
Previous ID SR-7670
Radar None
Original Reporter @AnthonyLatsis
Type Bug
Status Closed
Resolution Done

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s CodeCompletion
Labels Bug
Assignee @AnthonyLatsis
Priority Medium

md5: 7e94960cda9223cd492ba12045a005cd

Issue Description:

This only happens if the current context doesn't have any generic parameters, but a parent does.
The reason is that getGenericParamsOfContext returns only the generic parameters of the current context if there are any, otherwise the generic params of the parents. So the parameter gets added twice: as a member and as a parameter.

This method ({{getGenericParamsOfContext}}) is for some reason marked with a FIXME to be removed. Please tell me why if you know so I can take care of that as well.

class Foo<T> {

    func foo<U> (...) -> ...  // getGenericParamsOfContext: only U

    func doo(...) -> ... // getGenericParamsOfContext: T
}


![](Screen Shot 2018-05-13 at 9.22.56 AM.png)

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.code completionArea → source tooling: code completionsource toolingArea: IDE support, SourceKit, and other source tooling

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions