Debian Codegraph @

tools/trim/testdata/64.txtar

raw
1 Disjunctions.
2
3 If line 2 wasn't present,
4
5 out: #Schema & {type: "A"}
6
7 correctly gets simplified to
8
9 out: #Schema & _
10
11 because of the default.
12
13 However, with line 2 present, simplifying `out` in the same way is incorrect.
14
15 Note that v2 gets this wrong.
16
17 -- a.cue --
18 #Schema: {type: *"A" | string}
19 #Schema: {type: "A"} | {type: "CNAME"}
20 out: #Schema & {type: "A"}
21 -- out/trim-v3 --
22 == a.cue
23 #Schema: {type: *"A" | string}
24 #Schema: {type: "A"} | {type: "CNAME"}
25 out: #Schema & {type: "A"}
26 -- diff/-out/trim-v3<==>+out/trim --
27 diff old new
28 --- old
29 +++ new
30 @@ -1,4 +1,4 @@
31 == a.cue
32 #Schema: {type: *"A" | string}
33 #Schema: {type: "A"} | {type: "CNAME"}
34 -out: #Schema & {}
35 +out: #Schema & {type: "A"}
36 -- out/trim-v3-noshare --
37 == a.cue
38 #Schema: {type: *"A" | string}
39 #Schema: {type: "A"} | {type: "CNAME"}
40 out: #Schema & {type: "A"}
41 -- diff/-out/trim-v3-noshare<==>+out/trim --
42 diff old new
43 --- old
44 +++ new
45 @@ -1,4 +1,4 @@
46 == a.cue
47 #Schema: {type: *"A" | string}
48 #Schema: {type: "A"} | {type: "CNAME"}
49 -out: #Schema & {}
50 +out: #Schema & {type: "A"}
51 -- out/trim --
52 == a.cue
53 #Schema: {type: *"A" | string}
54 #Schema: {type: "A"} | {type: "CNAME"}
55 out: #Schema & {}