-- in.cue --
import "list"

l0: list.Repeat([int], 3)
l0: [1, 2, 3] @test(eq, [1, 2, 3])
l2: [...{a: int}]
l2: [{a: 1}, {a: 2, b: 3}] @test(eq, [{a: 1}, {a: 2, b: 3}])

// TODO: work out a decent way to specify length ranges of lists.
// l3: <=10*[int]
// l3: [1, 2, 3, ...]

s1: (list.Repeat([int], 6))[2:3] @test(eq, [int])
s2: [0, 2, 3][1:2]               @test(eq, [2])

i1: (list.Repeat([int], 6))[2]   @test(eq, int)
i2: [0, 2, 3][2]                 @test(eq, 3)

t0: [...{a: 8}]
t0: [{}] @test(eq, [{a: 8}])
t1: [...]
t1: [...int] @test(eq, [])

e0: list.Repeat([{}], 2)
e0: [{}] @test(err, code=eval, contains="incompatible list lengths", args=[1, 2], pos=[], hint="missing positions")
e1: [...int]
e1: [...float] @test(eq, [])
-- out/errors.txt --
[eval] e0: incompatible list lengths (1 and 2)
-- out/eval/stats --
Leaks:  0
Freed:  41
Reused: 25
Allocs: 16
Retain: 0

Unifications: 35
Conjuncts:    59
Disjuncts:    0

NumCloseIDs: 9
