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: structural cycle regression involving a builtin and repeated schemas #3634

Open
mvdan opened this issue Dec 24, 2024 · 0 comments
Open
Labels
evaluator evalv3 issues affecting only the evaluator version 3

Comments

@mvdan
Copy link
Member

mvdan commented Dec 24, 2024

# With the old evaluator.
env CUE_EXPERIMENT=evalv3=0
exec cue export

# With the new evaluator.
env CUE_EXPERIMENT=evalv3=1
exec cue export

-- input.cue --
package p

import "list"

#Schema: {
	required?: [...string] 
	properties?: [string]: null | #Schema
}

out: len([...#Schema] & list.Repeat([{
	#Schema // removing this fixes the bug!
	properties: foo: required: ["bar", "baz"]
}], 3))

As of f2c38f8:

# With the old evaluator. (0.011s)
> env CUE_EXPERIMENT=evalv3=0
> exec cue export
[stdout]
{
    "out": 3
}
# With the new evaluator. (0.033s)
> env CUE_EXPERIMENT=evalv3=1
> exec cue export
[stderr]
0.properties.foo: cannot combine regular field "required" with null:
    ./input.cue:7:25
0.properties.foo: conflicting values null and {required:["bar","baz"]} (mismatched types null and struct):
    ./input.cue:7:25
    ./input.cue:12:19
0.properties.foo: structural cycle:
    ./input.cue:7:32
0.properties.foo: 3 errors in empty disjunction::
    ./input.cue:10:25
[exit status 1]

Note that removing the embedded definition resolves the regression, which is very suspect.

Also note that this example is very similar to #3633.

@mvdan mvdan added Triage Requires triage/attention evaluator evalv3 issues affecting only the evaluator version 3 and removed Triage Requires triage/attention labels Dec 24, 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