summaryrefslogtreecommitdiff
path: root/test/slice.myr
blob: 359182c2314649712e3b58cdd64b5bb275be8c7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
use std
/* checks that taking slices of arrays works. should exit with 7 */
const main = {
	var a : int[3]
	var s

	s = a[:]
	s[0] = 3
	s[1] = 4
	s[2] = s[0] + s[1] + s.len
	std.exit(s[2])
}