1
0
mirror of https://github.com/golang/go synced 2024-11-05 17:46:16 -07:00
go/internal/lsp/analysis/fillreturns
Josh Baum 40866c6c36 internal/lsp/analysis/fillreturns: implement matching in fillreturns
The existing implementation looks for matching types in the declaration
and the leftmost value in the return statement. Instead, the analyzer
now searches across all the values in the return statement to find one
that matches the type in the declaration. Additionally, if a value in
the return statement does not match any type in the declaration, it is
not overriden.

Change-Id: I4d4aed0ef67e59bfd886b44055d523a8c478255c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/236962
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-06-11 16:18:57 +00:00
..
testdata/src/a internal/lsp/analysis/fillreturns: implement matching in fillreturns 2020-06-11 16:18:57 +00:00
fillreturns_test.go internal/lsp: add goreturns like functionality as quickfix 2020-04-01 19:27:44 +00:00
fillreturns.go internal/lsp/analysis/fillreturns: implement matching in fillreturns 2020-06-11 16:18:57 +00:00