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

internal/core: concreteness errors not reported when conflict errors are present in other values #1319

Open
verdverm opened this issue Oct 23, 2021 · 2 comments
Labels
NeedsDesign Functionality seems desirable, but not sure how it should look like. roadmap/errors Related to improving error messages.

Comments

@verdverm
Copy link

verdverm commented Oct 23, 2021

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

0.4.0

What did you do?

cue eval -c foo.cue
cue vet -c foo.cue

-- foo.cue --
s: "hello"
s: "world"      // conflicting values "hello" and "world"

A: foo: "bar"
a: A.goo        // undefined field

b: int          // incomplete field

m: [1,2]
v: m[2]         // index out of range

I expected all errors for fields which do not interact. Instead I saw a series of errors shown depending on what other errors were found prior.

  • conflicting values
  • index out of range
  • incomplete value

What did you expect to see?

s: conflicting values "world" and "hello":
    ./errors.cue:1:4
    ./errors.cue:2:4
a: undefined field: goo:
    ./errors.cue:5:6
b: incomplete value int
    ./errors.cue:7:4
v: index out of range [2] with length 2:
    ./errors.cue:10:6

What did you see instead?

s: conflicting values "world" and "hello":
    ./errors.cue:1:4
    ./errors.cue:2:4

if s is not present

v: index out of range [2] with length 2:
    ./errors.cue:10:6

if both s and v are not present

b: incomplete value int         // missing line information here
a: undefined field: goo:
    ./errors.cue:5:6

Errors are not in the order they appear. Having them in the same order as they appear in the file would be nice. Probably a separate issue.

@verdverm verdverm added NeedsInvestigation Triage Requires triage/attention labels Oct 23, 2021
@mpvl mpvl added roadmap/errors Related to improving error messages. and removed Triage Requires triage/attention labels Oct 26, 2021
@myitcv myitcv changed the title Concreteness errors not reported when conflict errors are present in other values internal/core: concreteness errors not reported when conflict errors are present in other values Nov 19, 2021
@myitcv myitcv added NeedsDesign Functionality seems desirable, but not sure how it should look like. and removed NeedsInvestigation labels Nov 19, 2021
@myitcv
Copy link
Member

myitcv commented Nov 19, 2021

Passing comment: we discussed the different types/categories of errors a good deal whilst considering #822.

@myitcv
Copy link
Member

myitcv commented Oct 14, 2022

See also the discussion in #1998.

cc @edouard-lopez

@myitcv myitcv removed the pre v1.0 label Oct 14, 2022
@myitcv myitcv added the zGarden label Jun 13, 2023
@mvdan mvdan removed the zGarden label Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsDesign Functionality seems desirable, but not sure how it should look like. roadmap/errors Related to improving error messages.
Projects
None yet
Development

No branches or pull requests

4 participants