Skip to content
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

x/tools/gopls: no type inference for builtin args in composite literals #43240

Open
muirdm opened this issue Dec 17, 2020 · 0 comments
Open

x/tools/gopls: no type inference for builtin args in composite literals #43240

muirdm opened this issue Dec 17, 2020 · 0 comments
Labels

Comments

@muirdm
Copy link

@muirdm muirdm commented Dec 17, 2020

We aren't giving proper completions in this case:

var foo []int
struct { i []int }{
  i: append(nil, <>), // want "foo..."
}

I presume the composite literal is messing up the "append" param type inference.

Note that we also don't infer the type in this case:

var foo []int
append([]int{}, <>) // want "foo..."

In the first example we need to infer based on the struct field type, and in the second example we need to infer based on the first "append" param type.

@gopherbot gopherbot added this to the Unreleased milestone Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.