Debian Codegraph @

tools/trim/testdata/25.txtar

raw
1 Make sure we do not remove the outer `x: 5` (line 6), even though it
2 is a tie with the inner `x: 5` (and the inner `x: 5` occurs earlier in
3 the file (line 2) so it would win in a tie-break).
4
5 What happens here is that we establish that line 1 requires (depends
6 on) line 6. Even though within x we have a tie between line 2 and line
7 6, we find that line 1 cannot be removed (because y only has 1 winner
8 in line 4, and line 4 requires line 1), and so therefore line 6 is
9 required, and so line 2 is redundant.
10
11 Contrast with 57.
12
13 -- a.cue --
14 if x == 5 {
15 x: 5
16 x: int
17 y: "hi"
18 }
19 x: 5
20 -- out/trim-v3 --
21 == a.cue
22 if x == 5 {
23 y: "hi"
24 }
25 x: 5
26 -- out/trim-v3-noshare --
27 == a.cue
28 if x == 5 {
29 y: "hi"
30 }
31 x: 5