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

cue cmd hides errors in comprehensions #3536

Open
mxey opened this issue Oct 24, 2024 · 0 comments
Open

cue cmd hides errors in comprehensions #3536

mxey opened this issue Oct 24, 2024 · 0 comments
Labels
NeedsInvestigation Triage Requires triage/attention

Comments

@mxey
Copy link
Contributor

mxey commented Oct 24, 2024

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

$ cue version
cue version v0.10.1

go version go1.23.2
      -buildmode exe
       -compiler gc
       -trimpath true
     CGO_ENABLED 0
          GOARCH arm64
            GOOS darwin
         GOARM64 v8.0
cue.lang.version v0.10.1

Does this issue reproduce with the latest stable release?

v0.10.1 is the latest stable.

What did you do?

run this testscript:

! exec cue cmd print1
! exec cue cmd print2

-- foo_tool.cue --
package foo

import (
	"tool/cli"
)

instances: {}
missingInstanceName: string

command: print1: task: {
	for _, t in instances[missingInstanceName] {
		(t): cli.Print & {text: t}
	}
}

command: print2: task: {
	for _, t in instances["foo"] {
		(t): cli.Print & {text: t}
	}
}

What did you expect to see?

PASS

I would have expected to receive errors for these two loops, because they do nonsensical lookups. Instead, CUE just “skips” them.

In other locations, the same lookups would lead to error messages, just not in the comprehension header.

What did you see instead?

unexpected command success

@mxey mxey added NeedsInvestigation Triage Requires triage/attention labels Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Triage Requires triage/attention
Projects
None yet
Development

No branches or pull requests

1 participant