Skip to content

evalv3: range issue? #3538

Closed
Closed
@cuematthew

Description

@cuematthew

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 _):

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions