# TODO:
# out/dependencies/all: origin should ideally be Let reference not v


-- in.cue --
v: w: u: d: 0

let X1 = {c: v}.c.w
let X2 = {c: {out: v}.out}.c.w
let X3 = {c: {out: v}.out}.c

let Y1 = {c: v}.c
let Y2 = {c: {out: v}.out}.c

a: b: {
	// all result in v.w
	x1: X1
	x2: X2
	x3: X3.w

	// all result in v
	// TODO: fix this for "All" mode. This can be done by getting rid of the
	// recurse flag and allowing the API to directly access the expressions
	// that need to be substituted.
	y1: Y1
	y2: Y2
}
-- out/dependencies/field --
line  reference    path of resulting vertex
-- out/dependencies-v3/all --
line  reference                path of resulting vertex
3:    {c: v}.c.w            => v.w
4:    {c: {out: v}.out}.c.w => v.w
14:   X3.w                  => v.w
7:    v                     => v
8:    v                     => v
-- diff/-out/dependencies-v3/all<==>+out/dependencies/all --
diff old new
--- old
+++ new
@@ -1,6 +1,6 @@
-line  reference    path of resulting vertex
-12:   X1        => v.w
-13:   X2        => v.w
-14:   X3.w      => v.w
-7:    v         => v
-8:    v         => v
+line  reference                path of resulting vertex
+3:    {c: v}.c.w            => v.w
+4:    {c: {out: v}.out}.c.w => v.w
+14:   X3.w                  => v.w
+7:    v                     => v
+8:    v                     => v
-- out/dependencies/all --
line  reference    path of resulting vertex
12:   X1        => v.w
13:   X2        => v.w
14:   X3.w      => v.w
7:    v         => v
8:    v         => v
-- diff/dependencies-v3/todo/p2 --
bring in line with evalv2
-- out/dependencies/dynamic --
line  reference    path of resulting vertex
12:   X1        => v.w
13:   X2        => v.w
14:   X3.w      => v.w
20:   Y1        => v
21:   Y2        => v
-- out/dependencies-v3/stats/field --
// COUNT: 0
-- out/dependencies-v3/stats/all --
// COUNT: 12
-- out/dependencies-v3/stats/dynamic --
// COUNT: 24
