You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cue version
ue version v0.12.0-8dc16dd
go version go1.22.1
-buildmode exe
-compiler gc
-ldflags -X cuelang.org/go/cmd/cue/cmd.version=v0.12.0-8dc16dd
CGO_ENABLED 1
GOARCH arm64
GOOS darwin
vcs git
vcs.revision 8dc16dd330172af44bd376d3f51b32c96e56be81
vcs.time 2025-01-28T14:37:26Z
vcs.modified false
cue.lang.version v0.12.0
Does this issue reproduce with the latest stable release?
Yes and no. Old and new evaluator both produce the same result with version 0.11.1 but still the test doesn't fail (as it should, in my opinion). The new evaluator in version 0.11.1 produces the same result as the old evaluator.
What did you do?
env CUE_EXPERIMENT=evalv3=1
exec cue vet out.cue
exec cue export out.cue -e test1
cmp stdout foo.golden
env CUE_EXPERIMENT=evalv3=0
exec cue vet out.cue
exec cue export out.cue -e test1
cmp stdout impossible.golden
-- foo.golden --
"foo"
-- impossible.golden --
"impossible"
-- out.cue --
#TypeA: string | {foo: int}
#fun1: {
in: #TypeA
out: [
// either `in` is a string
if (in & string) != _|_ {
in
},
// or `in` is has field `foo`
if in.foo != _|_ {
"foo"
},
"impossible" // in & #TypeA != _|_ !!
][0]
}
//ab: #TypeA ??
ab: {
foo: 1
bar: "15"
}
test1: {
let call = #fun1 & { in: ab }
call.out
}
What did you expect to see?
A failing test. cue vet should not accept this program because #fun1.in must unify with #TypeA but ab does not unify with #TypeA. Also #fun1.in is used it the calculation of the result (call.out), so it influences the result and it should have _|_ as value and thus call.out should be _|_, too. If my intuition is wrong and this program is indeed correct it should still have the same result in both evaluators.
What did you see instead?
A passing test showing that old and new evaluator produce different results and that a validity constraint (in: #TypeA) is being ignored.
The text was updated successfully, but these errors were encountered:
What version of CUE are you using (
cue version
)?0.12-rc1
Does this issue reproduce with the latest stable release?
Yes and no. Old and new evaluator both produce the same result with version 0.11.1 but still the test doesn't fail (as it should, in my opinion). The new evaluator in version 0.11.1 produces the same result as the old evaluator.
What did you do?
What did you expect to see?
A failing test.
cue vet
should not accept this program because#fun1.in
must unify with#TypeA
butab
does not unify with#TypeA
. Also#fun1.in
is used it the calculation of the result (call.out
), so it influences the result and it should have_|_
as value and thuscall.out
should be_|_
, too. If my intuition is wrong and this program is indeed correct it should still have the same result in both evaluators.What did you see instead?
A passing test showing that old and new evaluator produce different results and that a validity constraint (
in: #TypeA
) is being ignored.The text was updated successfully, but these errors were encountered: