...
1# DO NOT EDIT; generated by go run testdata/gen.go
2#
3#name: bound conversions
4#evalPartial
5-- in.cue --
6r0: int & >0.1 & <=1.9
7r1: int & >0.1 & <1.9
8r2: int & >=0.1 & <1.9
9r3: int & >=-1.9 & <=-0.1
10r4: int & >-1.9 & <=-0.1
11
12r5: >=1.1 & <=1.1
13r6: r5 & 1.1
14
15c1: (1.2 & >1.3) & <2
16c2: 1.2 & (>1.3 & <2)
17
18c3: 1.2 & (>=1 & <2)
19c4: 1.2 & (>=1 & <2 & int)
20-- out/def --
21r0: 1
22r1: 1
23r2: 1
24r3: -1
25r4: -1
26r5: 1.1
27r6: 1.1
28c1: _|_ // invalid value 1.2 (out of bound >1.3)
29c2: _|_ // invalid value 1.2 (out of bound >1.3)
30c3: 1.2
31c4: _|_ // conflicting values 1.2 and ((>=1 & <2) & int) (mismatched types float and int)
32-- out/legacy-debug --
33<0>{r0: 1, r1: 1, r2: 1, r3: -1, r4: -1, r5: 1.1, r6: 1.1, c1: _|_((>1.3 & 1.2):invalid value 1.2 (out of bound >1.3)), c2: _|_((>1.3 & 1.2):invalid value 1.2 (out of bound >1.3)), c3: 1.2, c4: _|_((1.2 & ((>=1 & <2) & int)):conflicting values 1.2 and ((>=1 & <2) & int) (mismatched types float and int))}
34-- out/compile --
35--- in.cue
36{
37 r0: ((int & >0.1) & <=1.9)
38 r1: ((int & >0.1) & <1.9)
39 r2: ((int & >=0.1) & <1.9)
40 r3: ((int & >=-1.9) & <=-0.1)
41 r4: ((int & >-1.9) & <=-0.1)
42 r5: (>=1.1 & <=1.1)
43 r6: (〈0;r5〉 & 1.1)
44 c1: ((1.2 & >1.3) & <2)
45 c2: (1.2 & (>1.3 & <2))
46 c3: (1.2 & (>=1 & <2))
47 c4: (1.2 & ((>=1 & <2) & int))
48}
49-- out/eval/stats --
50Leaks: 0
51Freed: 12
52Reused: 10
53Allocs: 2
54Retain: 0
55
56Unifications: 12
57Conjuncts: 35
58Disjuncts: 12
59-- out/evalalpha --
60Errors:
61c4: conflicting values 1.2 and int (mismatched types float and int):
62 ./in.cue:14:5
63 ./in.cue:14:23
64c1: invalid value 1.2 (out of bound >1.3):
65 ./in.cue:10:12
66 ./in.cue:10:6
67c2: invalid value 1.2 (out of bound >1.3):
68 ./in.cue:11:12
69 ./in.cue:11:5
70
71Result:
72(_|_){
73 // [eval]
74 r0: (int){ 1 }
75 r1: (int){ 1 }
76 r2: (int){ 1 }
77 r3: (int){ -1 }
78 r4: (int){ -1 }
79 r5: (number){ 1.1 }
80 r6: (float){ 1.1 }
81 c1: (_|_){
82 // [eval] c1: invalid value 1.2 (out of bound >1.3):
83 // ./in.cue:10:12
84 // ./in.cue:10:6
85 }
86 c2: (_|_){
87 // [eval] c2: invalid value 1.2 (out of bound >1.3):
88 // ./in.cue:11:12
89 // ./in.cue:11:5
90 }
91 c3: (float){ 1.2 }
92 c4: (_|_){
93 // [eval] c4: conflicting values 1.2 and int (mismatched types float and int):
94 // ./in.cue:14:5
95 // ./in.cue:14:23
96 }
97}
98-- diff/-out/evalalpha<==>+out/eval --
99diff old new
100--- old
101+++ new
102@@ -18,7 +18,7 @@
103 r3: (int){ -1 }
104 r4: (int){ -1 }
105 r5: (number){ 1.1 }
106- r6: (number){ 1.1 }
107+ r6: (float){ 1.1 }
108 c1: (_|_){
109 // [eval] c1: invalid value 1.2 (out of bound >1.3):
110 // ./in.cue:10:12
111-- diff/todo/p3 --
112Seems like a correct fix, but investigate.
113This is independent from the fact that we probably
114want to relax the type of float literals to number.
115-- out/eval --
116Errors:
117c4: conflicting values 1.2 and int (mismatched types float and int):
118 ./in.cue:14:5
119 ./in.cue:14:23
120c1: invalid value 1.2 (out of bound >1.3):
121 ./in.cue:10:12
122 ./in.cue:10:6
123c2: invalid value 1.2 (out of bound >1.3):
124 ./in.cue:11:12
125 ./in.cue:11:5
126
127Result:
128(_|_){
129 // [eval]
130 r0: (int){ 1 }
131 r1: (int){ 1 }
132 r2: (int){ 1 }
133 r3: (int){ -1 }
134 r4: (int){ -1 }
135 r5: (number){ 1.1 }
136 r6: (number){ 1.1 }
137 c1: (_|_){
138 // [eval] c1: invalid value 1.2 (out of bound >1.3):
139 // ./in.cue:10:12
140 // ./in.cue:10:6
141 }
142 c2: (_|_){
143 // [eval] c2: invalid value 1.2 (out of bound >1.3):
144 // ./in.cue:11:12
145 // ./in.cue:11:5
146 }
147 c3: (float){ 1.2 }
148 c4: (_|_){
149 // [eval] c4: conflicting values 1.2 and int (mismatched types float and int):
150 // ./in.cue:14:5
151 // ./in.cue:14:23
152 }
153}
View as plain text