Skip to content

Commit

Permalink
internal/core/adt: expose v3 optional field bug
Browse files Browse the repository at this point in the history
This will be fixed in a follow-up CL.

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: Icb7b7839c43d61d00bbc9cec872c9dcbece9a782
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1199915
Reviewed-by: Daniel Martí <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
mpvl committed Aug 23, 2024
1 parent e525f29 commit 4967eb4
Showing 1 changed file with 80 additions and 20 deletions.
100 changes: 80 additions & 20 deletions cue/testdata/references/optional.txtar
Original file line number Diff line number Diff line change
@@ -1,34 +1,94 @@
-- in.cue --
a: {
t1: a: {
foo?: int

b: foo
}
-- out/compile --
--- in.cue
{
a: {
foo?: int
b: 〈0;foo〉
}
t2: a: {
b: foo

foo?: int
}
-- out/eval/stats --
Leaks: 0
Freed: 4
Reused: 1
Allocs: 3
Retain: 0
Freed: 9
Reused: 4
Allocs: 5
Retain: 1

Unifications: 4
Conjuncts: 4
Disjuncts: 4
Unifications: 9
Conjuncts: 9
Disjuncts: 10
-- out/evalalpha --
(struct){
t1: (struct){
a: (struct){
foo?: (int){ int }
b: (_|_){
// [incomplete] t1.a.b: cannot reference optional field: foo:
// ./in.cue:4:5
}
}
}
t2: (struct){
a: (struct){
b: (int){ int }
foo?: (int){ int }
}
}
}
-- diff/-out/evalalpha<==>+out/eval --
diff old new
--- old
+++ new
@@ -10,10 +10,7 @@
}
t2: (struct){
a: (struct){
- b: (_|_){
- // [incomplete] t2.a.b: cannot reference optional field: foo:
- // ./in.cue:7:5
- }
+ b: (int){ int }
foo?: (int){ int }
}
}
-- diff/todo/p1 --
t2: reference resolves to optional field.
-- out/eval --
(struct){
a: (struct){
foo?: (int){ int }
b: (_|_){
// [incomplete] a.b: cannot reference optional field: foo:
// ./in.cue:4:5
t1: (struct){
a: (struct){
foo?: (int){ int }
b: (_|_){
// [incomplete] t1.a.b: cannot reference optional field: foo:
// ./in.cue:4:5
}
}
}
t2: (struct){
a: (struct){
b: (_|_){
// [incomplete] t2.a.b: cannot reference optional field: foo:
// ./in.cue:7:5
}
foo?: (int){ int }
}
}
}
-- out/compile --
--- in.cue
{
t1: {
a: {
foo?: int
b: 〈0;foo〉
}
}
t2: {
a: {
b: 〈0;foo〉
foo?: int
}
}
}

0 comments on commit 4967eb4

Please sign in to comment.