]> Cypherpunks repositories - gostls13.git/commit
go/types: don't drop type in n:1 var decl if one is given
authorRobert Griesemer <gri@golang.org>
Sat, 21 May 2016 00:26:24 +0000 (17:26 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 23 May 2016 18:19:40 +0000 (18:19 +0000)
commit30fc940c70ee5ee27f0a455248735b8b57f34fb7
tree277399aa56d0add2dd626f0356d44039e9bda823
parent65adb6ab9a91c2f4336e1e48f9e7c325dafa0213
go/types: don't drop type in n:1 var decl if one is given

In n:1 variable declarations (multiple lhs variables with single
multi-valued initialization expression) where also a variable
type is provided, make sure that that type is assigned to all
variables on the lhs before the init expression assignment is
checked. Otherwise, (some) variables are assumed to take the type
of the corresponding value of the multi-valued init expression.

Fixes #15755.

Change-Id: I969cb5a95c85e28dbb38abd7fa7df16ff5554c03
Reviewed-on: https://go-review.googlesource.com/23313
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/types/decl.go
src/go/types/testdata/issues.src