1
0
mirror of https://github.com/golang/go synced 2024-11-19 01:04:40 -07:00
go/internal/lsp/analysis/fillreturns
Josh Baum cef9fc3bc8 internal/lsp/analysis/fillreturns: broaden type equality
The existing implementation contains strict equality rules for
comparing the return type in the function declaration against
the return types in the function body. This causes the code in the
return statement to be incorrectly overriden with its corresponding
zero value type by the fillreturns analyzer.

Fixes golang/go#38707

Change-Id: I07522aaf85f2a5f811a86cbc0951ae61035ff55e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/236617
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-06-05 18:10:38 +00:00
..
testdata/src/a internal/lsp/analysis/fillreturns: broaden type equality 2020-06-05 18:10:38 +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: broaden type equality 2020-06-05 18:10:38 +00:00