What version of Go are you using (go version)?
$ go version
go version go1.16 linux/amd64
Does this issue reproduce with the latest release?
Yes
What did you do?
This snippet compiles:
var a int
var b int
(func() {
a, b = (func()(int,int){ return 1,1 })()
})()
What did you expect to see?
It should not compile because a and b are unused variables.
The compiler accepts it silently while go vet correctly reports an error.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
Yes
What did you do?
This snippet compiles:
var a int var b int (func() { a, b = (func()(int,int){ return 1,1 })() })()What did you expect to see?
It should not compile because
aandbare unused variables.The compiler accepts it silently while
go vetcorrectly reports an error.