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
dsbenghe
changed the title
evalv3 regression: Pattern constraint
evalv3 regression: Not matching pattern constraint does not fail
Jan 10, 2025
dsbenghe
changed the title
evalv3 regression: Not matching pattern constraint does not fail
evalv3: Not matching pattern constraint does not fail
Jan 10, 2025
Thank you for reporting; this does indeed look like a regression. Here is a simpler reproducer in testscript form:
# With the old evaluator.
env CUE_EXPERIMENT=evalv3=0
exec cue vet -c
# With the new evaluator.
env CUE_EXPERIMENT=evalv3=1
exec cue vet -c
-- input.cue --
package p
#Schema: [int]: string
data: #Schema
data: "foo": "bar"
# With the old evaluator. (0.010s)
> env CUE_EXPERIMENT=evalv3=0
> exec cue vet -c
[stderr]
data.foo: field not allowed:
./input.cue:3:10
./input.cue:5:7
./input.cue:6:7
[exit status 1]
FAIL: repro-evalv3.txtar:3: unexpected command failure
# With the new evaluator. (0.028s)
> env CUE_EXPERIMENT=evalv3=1
> exec cue vet -c
The old evaluator correctly fails, but the new evaluator succeeds unexpectedly.
mvdan
changed the title
evalv3: Not matching pattern constraint does not fail
evalv3 regression where a pattern matching definition allows non-matching field
Jan 12, 2025
mvdan
changed the title
evalv3 regression where a pattern matching definition allows non-matching field
evalv3 regression where a pattern constraint definition allows non-matching field
Jan 12, 2025
What version of CUE are you using (
cue version
)?cue version v0.11.1
go version go1.23.4
-buildmode exe
-compiler gc
-trimpath true
CGO_ENABLED 0
GOARCH amd64
GOOS windows
GOAMD64 v1
cue.lang.version v0.11.1
Does this issue reproduce with the latest stable release?
yes
What did you do?
#ContainerVersion: [int]: string
containersMap: #ContainerVersion
containersMap: "someid": "sometag"
What did you expect to see?
An error to happen as string doesn't match the int
What did you see instead?
CUE_EXPERIMENT="evalv3,toposort,embed"
cue export -e containersMap
{
"someid": "sometag"
}
It errors out fine if evalv3 experiment is not enabled.
The text was updated successfully, but these errors were encountered: