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
Does this issue reproduce with the latest stable release?
Yes (v0.10.0)
What did you do?
exec go mod tidy
! exec go run .
env CUE_EXPERIMENT=evalv3
! exec go run .
-- go.mod --
module test
require cuelang.org/go v0.11.0-alpha.5
-- main.go --
package main
import (
"log"
"cuelang.org/go/cue/cuecontext"
)
func main() {
ctx := cuecontext.New()
// Make sure script works with earlier CUE versions prior to https://review.gerrithub.io/c/cue-lang/cue/+/1202685
if os.Getenv("CUE_EXPERIMENT") == "evalv3" {
ctx = cuecontext.New(cuecontext.EvaluatorVersion(cuecontext.EvalV3))
}
a := ctx.CompileString(`null | close({a?: _})`)
b := ctx.CompileString(`quux: "boom"`)
err := a.Unify(b).Validate()
if err != nil {
log.Fatal(err)
}
}
What did you expect to see?
Passing test. Both evalv2 and evalv3 should both fail to validate this example.
What did you see instead?
> exec go mod tidy
> ! exec go run .
[stderr]
main.go:15: 2 errors in empty disjunction: (and 2 more errors)
exit status 1
[exit status 1]
> env CUE_EXPERIMENT=evalv3
> ! exec go run .
FAIL: /tmp/x.txtar:5: unexpected command success
The text was updated successfully, but these errors were encountered:
Here's another failure, quite possibly related. Again I couldn't get this to fail in a single CUE file example:
exec go mod tidy
exec go run .
env CUE_EXPERIMENT=evalv3
exec go run .
-- go.mod --
module test
require cuelang.org/go v0.11.0-alpha.5
-- main.go --
package main
import (
"log"
"os"
"cuelang.org/go/cue/cuecontext"
)
func main() {
ctx := cuecontext.New()
if os.Getenv("CUE_EXPERIMENT") == "evalv3" {
ctx = cuecontext.New(cuecontext.EvaluatorVersion(cuecontext.EvalV3))
}
a := ctx.CompileString(`close({{[=~"a"]: _}})`)
b := ctx.CompileString(`"a": 1`)
err := a.Unify(b).Validate()
if err != nil {
log.Fatal(err)
}
}
The failure I see is:
> exec go mod tidy
> exec go run .
> env CUE_EXPERIMENT=evalv3
> exec go run .
[stderr]
main.go:19: field not allowed: a
exit status 1
[exit status 1]
FAIL: /tmp/x.txtar:5: unexpected command failure
Note: if I remove the redundant braces inside the close call, I don't see the failure.
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest stable release?
Yes (v0.10.0)
What did you do?
What did you expect to see?
Passing test. Both evalv2 and evalv3 should both fail to validate this example.
What did you see instead?
The text was updated successfully, but these errors were encountered: