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

evalv3: range issue? #3538

Open
cuematthew opened this issue Oct 25, 2024 · 0 comments
Open

evalv3: range issue? #3538

cuematthew opened this issue Oct 25, 2024 · 0 comments
Labels

Comments

@cuematthew
Copy link
Contributor

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

80f4f236e29369a1f9fb4267644c8d29e7f97baa

What on earth did you do?

exec cue export o.cue
cmp stdout out.cue
-- o.cue --
import "list"

people: [
    {name: "bob"},
    {name: "alice"},
    {name: "john"}
]
people: [...{name!: _}] & list.MaxItems(len(_uniqueNames))

_uniqueNames: {
    for person in people { "\(person.name)": _ }
}
-- out.cue --
{
    "people": [
        {
            "name": "bob"
        },
        {
            "name": "alice"
        },
        {
            "name": "john"
        }
    ]
}

What's the story cowboy?

Well this works with evalv2. But with v3, I get _uniqueNames: cannot range over people (incomplete type _):

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

1 participant