compiler: allow to declare multiple compound types in a var decl
This commit is contained in:
parent
b4bad11699
commit
2cc58c3c9e
2 changed files with 18 additions and 14 deletions
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue