Skip to content

Commit 60c33d8

Browse files
committed
core/convert: Ensure Go -> CUE conversion respects struct field order
This applies both to conversion of Go values, and Go types. To do this, we need to inject fake position information into the adt and ast nodes that are created by the conversion. We need to make sure that adt nodes have their ast source fields correctly populated, and we need to ensure Vertexes have correct Structs. All of these are needed to ensure that toposort has enough information to be able to find and use position information. Fixes #3554. Signed-off-by: Matthew Sackman <[email protected]> Change-Id: Ifdc2cf802e69699aa75490d3bb610470b20cb38a Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1207908 Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Marcel van Lohuizen <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent f752335 commit 60c33d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2239
-2096
lines changed

cue/testdata/benchmarks/issue2176.txtar

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ output: {
6060
}
6161
-- out/eval/stats --
6262
Leaks: 90
63-
Freed: 4079
64-
Reused: 4074
65-
Allocs: 95
63+
Freed: 684
64+
Reused: 680
65+
Allocs: 94
6666
Retain: 1359
6767

68-
Unifications: 4161
69-
Conjuncts: 9489
70-
Disjuncts: 4804
68+
Unifications: 766
69+
Conjuncts: 3242
70+
Disjuncts: 1409
7171
-- out/evalalpha --
7272
(struct){
7373
#Datastream: (#struct){

cue/testdata/benchmarks/issue572.txtar

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ unified: {
1111
}
1212
-- out/eval/stats --
1313
Leaks: 0
14-
Freed: 4501
15-
Reused: 4497
16-
Allocs: 4
14+
Freed: 3001
15+
Reused: 2998
16+
Allocs: 3
1717
Retain: 0
1818

19-
Unifications: 4501
20-
Conjuncts: 8998
21-
Disjuncts: 4501
19+
Unifications: 3001
20+
Conjuncts: 7498
21+
Disjuncts: 3001
2222
-- out/eval --
2323
(struct){
2424
_entries(:p): (#list){

0 commit comments

Comments
 (0)