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

Silent failure / partial output when json encoding a unresolved disjunction #1257

Closed
addreas opened this issue Sep 15, 2021 · 0 comments
Closed

Comments

@addreas
Copy link

addreas commented Sep 15, 2021

My guess is that this has the same root cause as #1256.

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

$ cue version
cue version (devel) linux/amd64 

The master branch at commit 0f53054

Does this issue reproduce with the latest release?

Yes

What did you do?

exec cue eval

-- test.cue --
package test

import "encoding/json"

test: json.Marshal({test: (*1 | int) & (int | *2)})

What did you expect to see?

An error similar to the "encoding/yaml" equivalent:

error in call to encoding/yaml.Marshal: yaml: unsupported node 1|int|2 (*ast.BinaryExpr):
    ./test.cue:5:7

What did you see instead?

A single new line:


Partial output

Letting cue export do the json conversion silently fails differently:

exec cue export

-- test.cue --
package test

test: test: (*1 | int) & (int | *2)

Gets the partial output:

test: 
@addreas addreas added NeedsInvestigation Triage Requires triage/attention labels Sep 15, 2021
@mpvl mpvl added this to the v0.4.x milestone Oct 26, 2021
@mpvl mpvl added NeedsFix and removed NeedsInvestigation Triage Requires triage/attention labels Oct 26, 2021
@mpvl mpvl modified the milestones: v0.4.x, v0.4.1: bug fixes Nov 15, 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