This repository has been archived by the owner on Nov 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cue/cmd/cue: fix regression for -H flag
Instance iterator accidentally would include instance twice in some cases, which caused it to be unified into a new anonoymous package for which hidden fields would not be shown. Also adds an optimization in Unify to return one of the arguments if they are identical, instead of unifying. The setting the variable instead of returning makes using a debugger easier. Change-Id: I311c0d2dcb50d277a47eaaae352e5fb467935eba Reviewed-on: https://cue-review.googlesource.com/c/cue/+/9844 Reviewed-by: CUE cueckoo <[email protected]> Reviewed-by: Paul Jolly <[email protected]>
- Loading branch information
Showing
5 changed files
with
54 additions
and
5 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 |
---|---|---|
|
@@ -7,6 +7,10 @@ stdout '34' | |
|
||
cue eval -e _a tst.cue | ||
stdout '34' | ||
|
||
cue eval -H | ||
stdout '_a: 34' | ||
|
||
-- dep.cue -- | ||
package dep | ||
|
||
|
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,46 @@ | ||
cue eval pkg.cue -H | ||
cmp stdout expect-stdout | ||
|
||
cue eval -H | ||
cmp stdout expect-stdout | ||
|
||
cue eval file.cue -H | ||
cmp stdout expect-stdout | ||
|
||
-- pkg.cue -- | ||
package pkg | ||
|
||
_top: 1 | ||
|
||
a: _h0: int | ||
|
||
#foo: { | ||
_h1: string | ||
} | ||
|
||
{ | ||
_h2: string | ||
} | ||
|
||
-- file.cue -- | ||
_top: 1 | ||
|
||
a: _h0: int | ||
|
||
#foo: { | ||
_h1: string | ||
} | ||
|
||
{ | ||
_h2: string | ||
} | ||
|
||
-- expect-stdout -- | ||
_top: 1 | ||
a: { | ||
_h0: int | ||
} | ||
_h2: string | ||
#foo: { | ||
_h1: string | ||
} |
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