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: "conflicting values" error regression when a disjunction involves missing fields #3600

Open
mvdan opened this issue Nov 27, 2024 · 1 comment
Labels
evaluator evalv3 issues affecting only the evaluator version 3

Comments

@mvdan
Copy link
Member

mvdan commented Nov 27, 2024

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

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

-- input.cue --
package p

#PatchOp: {
	op:    "replace"
	value: _
} | {
	op:   "remove"
} | {
	op:   "copy"
	from: string
}
#Patch: {
	input:  #PatchOp
	output: input
}

params: {}
patched: (#Patch & {
	input: {
		op:    "replace"
		value: "\(params.missing)"
	}
}).output

As of c29fd02:

# With the old evaluator. (0.010s)
> env CUE_EXPERIMENT=evalv3=0
> exec cue vet -c=false
# With the new evaluator. (0.028s)
> env CUE_EXPERIMENT=evalv3=1
> exec cue vet -c=false
[stderr]
output.op: conflicting values "copy" and "replace":
    ./input.cue:9:8
    ./input.cue:20:10
output.op: conflicting values "remove" and "replace":
    ./input.cue:7:8
    ./input.cue:20:10

The config is incomplete, as params.missing is not a field that exists, but still - I think v2 was correct in not reporting the "conflicting values" errors which do not matter here.

@mvdan
Copy link
Member Author

mvdan commented Nov 28, 2024

Slightly smaller testscript:

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

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

-- input.cue --
package p

#PatchOp: {
	op:    "replace"
	value: _
} | {
	op:   "remove"
} | {
	op:   "copy"
	from: string
}

params: {}
patched: #PatchOp & {
	op:    "replace"
	value: "\(params.missing)"
}

@mvdan mvdan added the evalv3 issues affecting only the evaluator version 3 label Dec 10, 2024
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