compiler: allow to declare multiple compound types in a var decl

This commit is contained in:
Evgenii Stratonikov 2020-05-19 16:50:20 +03:00
parent b4bad11699
commit 2cc58c3c9e
2 changed files with 18 additions and 14 deletions

View file

@ -43,3 +43,15 @@ func TestMultiDeclarationLocal(t *testing.T) {
}`
eval(t, src, big.NewInt(6))
}
func TestMultiDeclarationLocalCompound(t *testing.T) {
src := `package foo
func Main() int {
var a, b, c []int
a = append(a, 1)
b = append(b, 2)
c = append(c, 3)
return a[0] + b[0] + c[0]
}`
eval(t, src, big.NewInt(6))
}