-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/adt: expose v3 optional field bug
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
Showing
1 changed file
with
80 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |