this repo has no description
0
fork

Configure Feed

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

internal/core/export: add failing test for issue #4254

cue def --inline-imports renames hidden identifiers in for-clause
sources but not the corresponding binding variables, producing
broken references.

In other words, the loop in the inlined imported package

for _v in data
for _v in _v {
_v
}

gets emitted as invalid CUE like

for _v in data
for _v in _v_HASH {
_v_HASH
}

where the references are rewritten as `cue def --inline-imports` should,
but the declarations do not, leading to inconsistency.

For #4254.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Ibc8f87c0ca607c914991ebd832d708c263878eb5
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1231148
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Matthew Sackman <matthew@cue.works>

+26
+3
internal/core/export/self_test.go
··· 49 49 "self/selfcontained/cyclic": `reference not properly substituted`, 50 50 "self-v3/selfcontained/cyclic": `reference not properly substituted`, 51 51 "self-v3-noshare/selfcontained/cyclic": `reference not properly substituted`, 52 + 53 + "self-v3/selfcontained/issue4254": `hidden for clause variable not renamed`, 54 + "self-v3-noshare/selfcontained/issue4254": `hidden for clause variable not renamed`, 52 55 }, 53 56 } 54 57
+23
internal/core/export/testdata/selfcontained/issue4254.txtar
··· 1 + #inlineImports: true 2 + 3 + -- cue.mod/module.cue -- 4 + module: "mod.test/a" 5 + language: version: "v0.9.0" 6 + 7 + -- in.cue -- 8 + import "mod.test/a/pkg" 9 + 10 + pkg 11 + 12 + -- pkg/pkg.cue -- 13 + package pkg 14 + 15 + data: _ 16 + 17 + #foo: { 18 + for _v in data 19 + for _v in _v { 20 + _v 21 + } 22 + } 23 + -- out/self/default --