compiler: allow to use copy()
return value
This commit is contained in:
parent
3d8c7af66c
commit
3af7ce8c6b
2 changed files with 18 additions and 0 deletions
|
@ -427,4 +427,14 @@ func TestCopy(t *testing.T) {
|
|||
}`
|
||||
eval(t, src, []byte{0, 3})
|
||||
})
|
||||
t.Run("AssignToVariable", func(t *testing.T) {
|
||||
src := `package foo
|
||||
func Main() int {
|
||||
src := []byte{3, 2, 1}
|
||||
dst := make([]byte, 2)
|
||||
n := copy(dst, src)
|
||||
return n
|
||||
}`
|
||||
eval(t, src, big.NewInt(2))
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue