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: disjunct of definitions that each reference an identical optional field results in incomplete evaluation #3576

Open
marxarelli opened this issue Nov 14, 2024 · 0 comments
Labels
NeedsInvestigation Triage Requires triage/attention

Comments

@marxarelli
Copy link

marxarelli commented Nov 14, 2024

I am trying out the v3 evaluator with an existing project and ran into some strange behavior with regards to incomplete (or unsimplified?) evaluation. After completely paring down my schema, I was able to repro the issue with the minimal configuration below.

Note that the golden examples below are from the v2 evaluator.

exec cue version
env CUE_EXPERIMENT=evalv3
exec cue eval -e foo foo.cue
cmp stdout stdout.golden

-- foo.cue --
#Run: {
	run!: string
	options?: #Option | [#Option, ...]
	if options != _|_ {
		optionsValue: options
	}
}

#Copy: {
	copy!: string
	options?: #Option | [#Option, ...]
	if options != _|_ {
		optionsValue: options
	}
}

#Option: {}

foo: #Run | #Copy
foo: run: "make"

-- stdout.golden --
run: "make"

If I remove the conditional, the entire evaluation result is empty.

env CUE_EXPERIMENT=evalv3
exec cue eval -e foo foo.cue
cmp stdout stdout.golden

-- foo.cue --
#Run: {
	run!: string
	options?: #Option | [#Option, ...]
	optionsValue: options
}

#Copy: {
	copy!: string
	options?: #Option | [#Option, ...]
	optionsValue: options
}

#Option: {}

foo: #Run | #Copy
foo: run: "make"

-- stdout.golden --
run: "make"

(BTW, thanks for all the hard work on the new evaluator. I'm very much looking forward to it when it's ready.)

@marxarelli marxarelli added NeedsInvestigation Triage Requires triage/attention labels Nov 14, 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