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
env CUE_EXPERIMENT=evalv3=0
exec cue vet -c=false in.cue
env CUE_EXPERIMENT=evalv3=1
exec cue vet -c=false in.cue
-- in.cue --
#Schema: {
schemaField: number
}
out1: {
out2: #Schema & {
if false {
schemaField: 3
}
}
}
I would expect this testscript to pass - the old and new evaluator should agree that the above is valid CUE. However:
> env CUE_EXPERIMENT=evalv3=0
> exec cue vet -c=false in.cue
> env CUE_EXPERIMENT=evalv3=1
> exec cue vet -c=false in.cue
[stderr]
out1.out2.schemaField: field not allowed:
./in.cue:8:17
./in.cue:2:2
./in.cue:8:4
[exit status 1]
FAIL: f1040.cue:5: unexpected command failure
The error seems wrong; we are only closing one struct here, #Schema, and it does define and allow the schemaField field.
Note that the evalv3 regression goes away if I swap if false for if true. Similarly, if I swap schemaField: 3 for an embedding like { schemaField: 3 }, the error also goes away. Both seem supporting evidence for my reasoning above.
The text was updated successfully, but these errors were encountered:
Closedness was reported incorrectly for the following case,
because when handling comprehensions one should look at
the arcType of the closedcontext, not the Vertex.
In fact, the Vertex arc MUST always be decided by the time
the closeContext finishes. Add an assertion to this effect.
out1: out2: #Schema & {
if false {
schemaField: 3
}
}
Fixescue-lang#3483
Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: I21e3bf45cf765940d6106d7ae671ea2ace985593
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202419
Reviewed-by: Daniel Martí <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Reduced from https://github.com/tmm1/taxes.cue/blob/c7a9fefa2fa115b5d06fb952636a475823ff14a9/return.cue#L215, which is correctly defined in the
#Form1040
schema.As of b51914f:
I would expect this testscript to pass - the old and new evaluator should agree that the above is valid CUE. However:
The error seems wrong; we are only closing one struct here,
#Schema
, and it does define and allow theschemaField
field.Note that the evalv3 regression goes away if I swap
if false
forif true
. Similarly, if I swapschemaField: 3
for an embedding like{ schemaField: 3 }
, the error also goes away. Both seem supporting evidence for my reasoning above.The text was updated successfully, but these errors were encountered: