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: "cyclic reference to field" regression when using a comprehension #3708

Open
mvdan opened this issue Jan 29, 2025 · 1 comment
Open
Labels
evaluator evalv3 issues affecting only the evaluator version 3

Comments

@mvdan
Copy link
Member

mvdan commented Jan 29, 2025

# With the old evaluator.
env CUE_EXPERIMENT=evalv3=0
exec cue vet -c input.cue

# With the new evaluator.
env CUE_EXPERIMENT=evalv3=1
exec cue vet -c input.cue

-- input.cue --
package p

out: people.bob.kind

people: [string]: {
	kind:  "person"
	name?: string
}

if true {
	people: bob: name: "Bob"
}

As of 870bfc2:

# With the old evaluator. (0.010s)
> env CUE_EXPERIMENT=evalv3=0
> exec cue vet -c input.cue
# With the new evaluator. (0.035s)
> env CUE_EXPERIMENT=evalv3=1
> exec cue vet -c input.cue
[stderr]
people.bob.name: cyclic reference to field bob:
    ./input.cue:10:1
[exit status 1]

Note that this appears to be a bug because:

  • Removing the if true wrapping fixes the bug
  • Reordering out: to be at the end of the file fixes the bug
@mvdan mvdan added evaluator evalv3 issues affecting only the evaluator version 3 labels Jan 29, 2025
@mvdan
Copy link
Member Author

mvdan commented Jan 29, 2025

Reduced from our internal infra repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
evaluator evalv3 issues affecting only the evaluator version 3
Projects
None yet
Development

No branches or pull requests

1 participant