forked from cue-lang/cue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/export: don't add empty temp struct
Fixes bug where a temporary struct was added even if the underlying value itself was not a struct. Fixes cue-lang#1284 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I29c615c4670594d00725dd54e13ca96b3b33e304 Signed-off-by: Marcel van Lohuizen <[email protected]> Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/527841 Unity-Result: CUEcueckoo <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Paul Jolly <[email protected]>
- Loading branch information
Showing
2 changed files
with
112 additions
and
8 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
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 |
---|---|---|
@@ -0,0 +1,105 @@ | ||
-- in.cue -- | ||
a0: { | ||
l: ["a",...] | ||
l: ["a","b",...] | ||
} | ||
a1: { | ||
l: [...] | ||
l: ["a",...] | ||
l: ["a","b",...] | ||
} | ||
a2: { | ||
l: [...] | ||
l: ["a",...] | ||
l: ["a","b",...] | ||
l: {} | ||
} | ||
a3: { | ||
l: [...] | ||
l: ["a",...] | ||
l: ["a","b",...] | ||
l: { _ } | ||
} | ||
a4: { | ||
l: [...] | ||
l: ["a",...] | ||
l: ["a","b",...] | ||
l: { _, #foo: 1 } | ||
l: { _, @decl(1) } | ||
} | ||
-- out/definition -- | ||
a0: { | ||
l: ["a", ...] & ["a", "b", ...] | ||
} | ||
a1: { | ||
l: [...] & ["a", ...] & ["a", "b", ...] | ||
} | ||
a2: { | ||
l: [...] & ["a", ...] & ["a", "b", ...] & {} | ||
} | ||
a3: { | ||
l: [...] & ["a", ...] & ["a", "b", ...] & { | ||
_ | ||
} | ||
} | ||
a4: { | ||
l: [...] & ["a", ...] & ["a", "b", ...] & { | ||
@decl(1) | ||
_ | ||
#foo: 1 | ||
} | ||
} | ||
-- out/doc -- | ||
[] | ||
[a0] | ||
[a0 l] | ||
[a0 l 0] | ||
[a0 l 1] | ||
[a1] | ||
[a1 l] | ||
[a1 l 0] | ||
[a1 l 1] | ||
[a2] | ||
[a2 l] | ||
[a2 l 0] | ||
[a2 l 1] | ||
[a3] | ||
[a3 l] | ||
[a3 l 0] | ||
[a3 l 1] | ||
[a4] | ||
[a4 l] | ||
[a4 l #foo] | ||
[a4 l 0] | ||
[a4 l 1] | ||
-- out/value -- | ||
== Simplified | ||
_|_ // a2.l: conflicting values ["a","b",...] and {} (mismatched types list and struct) | ||
== Raw | ||
_|_ // a2.l: conflicting values ["a","b",...] and {} (mismatched types list and struct) | ||
== Final | ||
_|_ // a2.l: conflicting values ["a","b",...] and {} (mismatched types list and struct) | ||
== All | ||
{ | ||
a0: { | ||
l: ["a", "b"] | ||
} | ||
a1: { | ||
l: ["a", "b"] | ||
} | ||
a2: { | ||
l: _|_ // a2.l: conflicting values ["a","b",...] and {} (mismatched types list and struct) | ||
} | ||
a3: { | ||
l: ["a", "b"] | ||
} | ||
a4: { | ||
l: { | ||
@decl(1) | ||
#foo: 1 | ||
["a", "b"] | ||
} | ||
} | ||
} | ||
== Eval | ||
_|_ // a2.l: conflicting values ["a","b",...] and {} (mismatched types list and struct) |