compiler: support byte slice declaration

This commit is contained in:
Evgenii Stratonikov 2020-05-19 17:02:26 +03:00
parent 582469028b
commit 34a4c15932
2 changed files with 13 additions and 0 deletions

View file

@ -130,6 +130,17 @@ var sliceTestCases = []testCase{
}`,
[]byte{2, 3},
},
{
"declare byte slice",
`package foo
func Main() []byte {
var a []byte
a = append(a, 1)
a = append(a, 2)
return a
}`,
[]byte{1, 2},
},
{
"declare compound slice",
`package foo