Skip to content

Commit 447e98d

Browse files
committed
internal/core/adt: eliminate recursive processing on bottom
This saves a whole bunch of additional processing and prevents a bunch of additional errors. Fixes #3840 Fixes #3851 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I88899b607b9228a2070f74a7f08864d015bda690 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1212232 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
1 parent d58c804 commit 447e98d

24 files changed

+362
-932
lines changed

Diff for: cue/testdata/basicrewrite/013_obj_unify.txtar

+6-22
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ Errors:
8686
e: conflicting values 1 and {a:3} (mismatched types int and struct):
8787
./in.cue:7:5
8888
./in.cue:8:4
89-
e: cannot combine regular field "a" with 1:
90-
./in.cue:8:8
91-
./in.cue:7:5
9289

9390
Result:
9491
(_|_){
@@ -113,34 +110,21 @@ Result:
113110
// [eval] e: conflicting values 1 and {a:3} (mismatched types int and struct):
114111
// ./in.cue:7:5
115112
// ./in.cue:8:4
116-
// e: cannot combine regular field "a" with 1:
117-
// ./in.cue:8:8
118-
// ./in.cue:7:5
119-
a: (int){ 3 }
113+
a: (_|_){// 3
114+
}
120115
}
121116
}
122117
-- diff/-out/evalalpha<==>+out/eval --
123118
diff old new
124119
--- old
125120
+++ new
126-
@@ -2,6 +2,9 @@
127-
e: conflicting values 1 and {a:3} (mismatched types int and struct):
128-
./in.cue:7:5
129-
./in.cue:8:4
130-
+e: cannot combine regular field "a" with 1:
131-
+ ./in.cue:8:8
132-
+ ./in.cue:7:5
133-
134-
Result:
135-
(_|_){
136-
@@ -26,6 +29,9 @@
121+
@@ -26,6 +26,7 @@
137122
// [eval] e: conflicting values 1 and {a:3} (mismatched types int and struct):
138123
// ./in.cue:7:5
139124
// ./in.cue:8:4
140-
+ // e: cannot combine regular field "a" with 1:
141-
+ // ./in.cue:8:8
142-
+ // ./in.cue:7:5
143-
a: (int){ 3 }
125+
- a: (int){ 3 }
126+
+ a: (_|_){// 3
127+
+ }
144128
}
145129
}
146130
-- diff/explanation --

Diff for: cue/testdata/benchmarks/issue3514.txtar

+8-8
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ _schema: {
3636
#timezone: or([for i in list.Range(0, 571, 1) {"\(i)"}])
3737
}
3838
-- out/evalalpha/stats --
39-
Leaks: 3690
39+
Leaks: 3645
4040
Freed: 0
4141
Reused: 0
42-
Allocs: 3690
42+
Allocs: 3645
4343
Retain: 0
4444

45-
Unifications: 114
46-
Conjuncts: 7138
45+
Unifications: 69
46+
Conjuncts: 7053
4747
Disjuncts: 2386
4848
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
4949
diff old new
@@ -55,17 +55,17 @@ diff old new
5555
-Reused: 30511
5656
-Allocs: 608
5757
-Retain: 47
58-
+Leaks: 3690
58+
+Leaks: 3645
5959
+Freed: 0
6060
+Reused: 0
61-
+Allocs: 3690
61+
+Allocs: 3645
6262
+Retain: 0
6363

6464
-Unifications: 189
6565
-Conjuncts: 92950
6666
-Disjuncts: 31139
67-
+Unifications: 114
68-
+Conjuncts: 7138
67+
+Unifications: 69
68+
+Conjuncts: 7053
6969
+Disjuncts: 2386
7070
-- out/eval/stats --
7171
Leaks: 27

0 commit comments

Comments
 (0)