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: premature type conversion when completing generic func call #51780

Closed
muirdm opened this issue Mar 18, 2022 · 1 comment
Closed
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@muirdm
Copy link

muirdm commented Mar 18, 2022

On gopls master (779dfa4)

func foo[T float64 | int](a T) T {
	return a
}

func main() {
	var _ int = fo<>
}

Completing to "foo" at <> inserts "int(foo[T float64|int](a T))". The "int()" type conversion is a bit premature.

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Mar 18, 2022
@gopherbot gopherbot added this to the Unreleased milestone Mar 18, 2022
@muirdm muirdm changed the title x/tools/gopls: premature type conversion when calling generic func x/tools/gopls: premature type conversion when completing generic func call Mar 18, 2022
@suzmue suzmue modified the milestones: Unreleased, gopls/on-deck Mar 18, 2022
@gopherbot
Copy link

Change https://go.dev/cl/394016 mentions this issue: lsp/completion: fix bogus generic func conversion

@findleyr findleyr modified the milestones: gopls/on-deck, gopls/v0.8.2 Mar 31, 2022
@rsc rsc unassigned muirdm Jun 22, 2022
@golang golang locked and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants