# Tests that a list-length mismatch involving comprehensions reports the
# true expanded element count, not the number of syntactic list elements.
# https://cuelang.org/issue/3007
-- in.cue --
// A comprehension yields more values than the closed list allows.
x: [int]
x: [for v in [1, 2, 3] {v}] @test(err, code=eval, contains="incompatible list lengths (1 and 3)", pos=[0:4])

// Multiple comprehensions are tallied together.
a: [0, 1, 2]
b: [3, 4, 5]
c: [int, int, int, int]
c: [for e in a {e}, for e in b {e}] @test(err, code=eval, contains="incompatible list lengths (4 and 6)", pos=[0:4])
-- out/errors.txt --
[eval] x: incompatible list lengths (1 and 3):
    ./in.cue:3:4
[eval] c: incompatible list lengths (4 and 6):
    ./in.cue:9:4
-- out/eval/stats --
Leaks:  0
Freed:  24
Reused: 12
Allocs: 12
Retain: 0

Unifications: 24
Conjuncts:    49
Disjuncts:    0

NumCloseIDs: 27
