this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

cmd/cue/cmd: add failing test for issue #4202

cue eval -e produces an internal error when a for comprehension's
if-guard references the same definition used in a pattern constraint
on the iterated struct.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Ifcb05b680345fbe72cd9748cdd6ee8476be2cf53
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1231218
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Marcel van Lohuizen <mpvl@gmail.com>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>

+16
+16
cmd/cue/cmd/testdata/script/eval_e.txtar
··· 15 15 exec cue export --out text -e 'yaml.MarshalStream(X)' issue999/x.cue 16 16 cmp stdout expect/issue999/stdout 17 17 18 + # Issue #4202: cue eval -e should not produce an internal error 19 + # when a for comprehension's if-guard references the same definition 20 + # used in a pattern constraint on the iterated struct. 21 + exec cue eval -e _out issue4202/x.cue 22 + stdout '_\|_' 23 + 18 24 -- expect/nonExist/stdout -- 19 25 -- expect/nonExist/stderr -- 20 26 reference "nonExist" not found: ··· 65 71 --- 66 72 b: 2 67 73 74 + -- issue4202/x.cue -- 75 + #K: string 76 + 77 + x: [#K]: _ 78 + x: a: 1 79 + 80 + _out: [ 81 + for k, v in x 82 + if k =~ #K {v}, 83 + ]