Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lack of error message in cue export on incomplete value #1304

Closed
joulaud opened this issue Oct 17, 2021 · 1 comment
Closed

lack of error message in cue export on incomplete value #1304

joulaud opened this issue Oct 17, 2021 · 1 comment

Comments

@joulaud
Copy link

joulaud commented Oct 17, 2021

What version of CUE are you using (cue version)?

$ cue version
cue version 0.4.0 linux/amd64

Does this issue reproduce with the latest release?

yes

What did you do?

cat <<'EOF' >x.cue
toto: {
       _current: *"toto" | string
	value:     *_|_ | _current
}
tata: "tata"
EOF

cue export x.cue

What did you expect to see?

either error message on stderr like

toto: value: incomplete value *"toto" | string

or (better?) unified result on stdout

toto: value: "toto"
tata: "tata"

What did you see instead?

unuseful error message on stderr

toto:

full session

$ cat <<'EOF' >y.cue
toto: {
       _current: *"toto" | string
        value:     *_|_ | _current
}
tata: "tata"
EOF

$ cue export y.cue
toto: 

$ cue eval y.cue
toto: {
    value: "toto" | string
}
tata: "tata"
@joulaud joulaud added NeedsInvestigation Triage Requires triage/attention labels Oct 17, 2021
@mpvl
Copy link
Member

mpvl commented Oct 26, 2021

This seems to be a bug, triggered by the combination of usage of *_|_ and another nested disjunction with default value.

Reproducer:

toto: value: *_|_ | (*"toto" | string)

Judging from the output, it bails printing in an unexpected matter. Given that eval works fine, I expect this is an export bug.

@mpvl mpvl added NeedsFix and removed NeedsInvestigation Triage Requires triage/attention labels Oct 26, 2021
@mpvl mpvl added this to the v0.4.x milestone Oct 26, 2021
@mpvl mpvl modified the milestones: v0.4.x, v0.4.1: bug fixes Nov 14, 2021
cueckoo pushed a commit that referenced this issue Nov 15, 2021
Default should return unmarked disjuncts, instead
of an error.

Fixes #1304
Fixes #1257

Signed-off-by: Marcel van Lohuizen <[email protected]>

Change-Id: Idfe0302ede7a35cac7dfbbbf0c27242ebb1c3b32
Signed-off-by: Marcel van Lohuizen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants