...
1// Issue #729
2-- in.cue --
3ifScalar: {
4 _#cond: true
5
6 if _#cond {5}
7}
8
9ifScalarConflict: {
10 _#cond: true
11
12 if _#cond {5}
13
14 "soo"
15}
16
17ifScalarNested: {
18 _#cond: true
19
20 if _#cond {{{5}}}
21
22}
23-- out/eval/stats --
24Leaks: 0
25Freed: 7
26Reused: 4
27Allocs: 3
28Retain: 3
29
30Unifications: 7
31Conjuncts: 13
32Disjuncts: 7
33-- out/evalalpha --
34Errors:
35ifScalarConflict: conflicting values "soo" and 5 (mismatched types string and int):
36 ./in.cue:10:13
37 ./in.cue:12:2
38
39Result:
40(_|_){
41 // [eval]
42 ifScalar: (int){
43 5
44 _#cond: (bool){ true }
45 }
46 ifScalarConflict: (_|_){
47 // [eval] ifScalarConflict: conflicting values "soo" and 5 (mismatched types string and int):
48 // ./in.cue:10:13
49 // ./in.cue:12:2
50 _#cond: (bool){ true }
51 }
52 ifScalarNested: (int){
53 5
54 _#cond: (bool){ true }
55 }
56}
57-- diff/-out/evalalpha<==>+out/eval --
58diff old new
59--- old
60+++ new
61@@ -1,6 +1,5 @@
62 Errors:
63 ifScalarConflict: conflicting values "soo" and 5 (mismatched types string and int):
64- ./in.cue:10:2
65 ./in.cue:10:13
66 ./in.cue:12:2
67
68@@ -13,7 +12,6 @@
69 }
70 ifScalarConflict: (_|_){
71 // [eval] ifScalarConflict: conflicting values "soo" and 5 (mismatched types string and int):
72- // ./in.cue:10:2
73 // ./in.cue:10:13
74 // ./in.cue:12:2
75 _#cond: (bool){ true }
76-- diff/todo/p2 --
77Missing error positions
78-- out/eval --
79Errors:
80ifScalarConflict: conflicting values "soo" and 5 (mismatched types string and int):
81 ./in.cue:10:2
82 ./in.cue:10:13
83 ./in.cue:12:2
84
85Result:
86(_|_){
87 // [eval]
88 ifScalar: (int){
89 5
90 _#cond: (bool){ true }
91 }
92 ifScalarConflict: (_|_){
93 // [eval] ifScalarConflict: conflicting values "soo" and 5 (mismatched types string and int):
94 // ./in.cue:10:2
95 // ./in.cue:10:13
96 // ./in.cue:12:2
97 _#cond: (bool){ true }
98 }
99 ifScalarNested: (int){
100 5
101 _#cond: (bool){ true }
102 }
103}
104-- out/compile --
105--- in.cue
106{
107 ifScalar: {
108 _#cond: true
109 if 〈0;_#cond〉 {
110 5
111 }
112 }
113 ifScalarConflict: {
114 _#cond: true
115 if 〈0;_#cond〉 {
116 5
117 }
118 "soo"
119 }
120 ifScalarNested: {
121 _#cond: true
122 if 〈0;_#cond〉 {
123 {
124 {
125 5
126 }
127 }
128 }
129 }
130}
View as plain text