compiler: allow variables in byte-slice literals
This commit is contained in:
parent
e4d82f5956
commit
5f3b8c6d51
2 changed files with 24 additions and 2 deletions
|
@ -310,6 +310,17 @@ var sliceTestCases = []testCase{
|
|||
`,
|
||||
big.NewInt(2),
|
||||
},
|
||||
{
|
||||
"literal byte-slice with variable values",
|
||||
`package foo
|
||||
const sym1 = 's'
|
||||
func Main() []byte {
|
||||
sym2 := byte('t')
|
||||
sym4 := byte('i')
|
||||
return []byte{sym1, sym2, 'r', sym4, 'n', 'g'}
|
||||
}`,
|
||||
[]byte("string"),
|
||||
},
|
||||
}
|
||||
|
||||
func TestSliceOperations(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue