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

using list concatenate operator causes non-concrete value error #3112

Open
networkhermit opened this issue May 2, 2024 · 1 comment
Open

Comments

@networkhermit
Copy link

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

$ cue version
cue version 0.8.1

go version go1.22.2
      -buildmode pie
       -compiler gc
       -trimpath true
  DefaultGODEBUG httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
     CGO_ENABLED 1
          GOARCH amd64
            GOOS linux
         GOAMD64 v1

Does this issue reproduce with the latest stable release?

Yes.

What did you do?

  1. copy the following code to test_tool.cue
package main

import (
	"list"
	"tool/cli"
	"tool/exec"
)

ask: cli.Ask & {
	prompt:   "What's your name?"
	response: string
}

command: test1: exec.Run & {
	{cmd: ["echo"] + [ask.response]}
}

command: test2: exec.Run & {
	{cmd: list.Concat([["echo"], [ask.response]])}// works
}

command: test3: exec.Run & {
	{cmd: "echo " + ask.response}// works
}
  1. run cue cmd test1

What did you expect to see?

What's your name?

What did you see instead?

command.test1.cmd.1: non-concrete value string:
    ./test_tool.cue:11:12
@networkhermit networkhermit added NeedsInvestigation Triage Requires triage/attention labels May 2, 2024
@mvdan
Copy link
Member

mvdan commented May 14, 2024

Given that we plan to phase out list arithmetic in favor of list.Concat soon (#2237), and seeing how list.Concat works well in your example, I suspect this might not be worth attempting to fix.

@mvdan mvdan removed the Triage Requires triage/attention label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants