-- in.cue --
import "list"

t1: {
	[=~"^l"]: [1, 2, 3, "str", [1], { foo: 1 }]

	l1: list.MatchN(>0, [string])
	l2: list.MatchN(1, number)
	l3: list.MatchN(>1, string)
	l4: list.MatchN(0, number)
	l5: list.MatchN(string, [int])
	l6: list.MatchN(>0, #TOO)
}

issue3519: {
    a: [{}]
    a: list.MatchN(1, {a!: _})
}

#TOO: {too: int}
-- out/list --
Errors:
t1.l1: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy >0:
    ./in.cue:6:6
    ./in.cue:4:12
    ./in.cue:6:18
t1.l2: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 3: does not satisfy 1:
    ./in.cue:7:6
    ./in.cue:4:12
    ./in.cue:7:18
    ./in.cue:7:21
t1.l3: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 1: does not satisfy >1:
    ./in.cue:8:6
    ./in.cue:4:12
    ./in.cue:8:18
    ./in.cue:8:22
t1.l4: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 3: does not satisfy 0:
    ./in.cue:9:6
    ./in.cue:4:12
    ./in.cue:9:18
    ./in.cue:9:21
t1.l5: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 1: does not satisfy string:
    ./in.cue:10:6
    ./in.cue:4:12
    ./in.cue:10:18
t1.l6: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy >0:
    ./in.cue:11:6
    ./in.cue:4:12
    ./in.cue:11:18
issue3519.a: invalid value [{}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy 1:
    ./in.cue:16:8
    ./in.cue:15:8
    ./in.cue:16:20

Result:
t1: {
	l1: _|_ // t1.l1: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy >0
	l2: _|_ // t1.l2: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 3: does not satisfy 1
	l3: _|_ // t1.l3: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 1: does not satisfy >1
	l4: _|_ // t1.l4: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 3: does not satisfy 0
	l5: _|_ // t1.l5: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 1: does not satisfy string
	l6: _|_ // t1.l6: invalid value [1,2,3,"str",[1],{foo:1}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy >0
}
issue3519: {
	a: _|_ // issue3519.a: invalid value [{}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy 1
}
#TOO: {
	too: int
}
