-- in.cue --
@experiment(try)

// Struct-form try with optional reference
a: b: {
	try { result: c? + d }
}
c: 1
d: 2

// Assignment-form try binding optional value
e: f: {
	try x = g? { result: x + h }
}
g: 10
h: 20

// Try with else clause - else triggers when optional is undefined
i: j: {
	try { val: k? } else { fallback: m }
}
k?: int
m: 100
-- out/dependencies-v3/field --
line  reference    path of resulting vertex
-- diff/-out/dependencies-v3/field<==>+out/dependencies/field --
diff old new
--- old
+++ new
@@ -1,4 +1,1 @@
 line  reference    path of resulting vertex
-4:    c         => c
-10:   g         => g
-17:   k         => k
-- out/dependencies/field --
line  reference    path of resulting vertex
4:    c         => c
10:   g         => g
17:   k         => k
-- out/dependencies-v3/all --
line  reference    path of resulting vertex
5:    c         => c
5:    d         => d
-- diff/-out/dependencies-v3/all<==>+out/dependencies/all --
diff old new
--- old
+++ new
@@ -1,7 +1,3 @@
 line  reference    path of resulting vertex
-4:    c         => c
-4:    d         => d
-10:   g         => g
-10:   h         => h
-17:   k         => k
-17:   m         => m
+5:    c         => c
+5:    d         => d
-- out/dependencies/all --
line  reference    path of resulting vertex
4:    c         => c
4:    d         => d
10:   g         => g
10:   h         => h
17:   k         => k
17:   m         => m
-- out/dependencies-v3/dynamic --
line  reference    path of resulting vertex
5:    c         => c
5:    d         => d
-- diff/-out/dependencies-v3/dynamic<==>+out/dependencies/dynamic --
diff old new
--- old
+++ new
@@ -1,7 +1,3 @@
 line  reference    path of resulting vertex
-4:    c         => c
-4:    d         => d
-10:   g         => g
-10:   h         => h
-17:   k         => k
-17:   m         => m
+5:    c         => c
+5:    d         => d
-- out/dependencies/dynamic --
line  reference    path of resulting vertex
4:    c         => c
4:    d         => d
10:   g         => g
10:   h         => h
17:   k         => k
17:   m         => m
-- out/dependencies-v3/stats/field --
// COUNT: 0
-- out/dependencies-v3/stats/all --
// COUNT: 2
-- out/dependencies-v3/stats/dynamic --
// COUNT: 4
