Open jpluscplusm opened 2 weeks ago
I agree that this seems to be a regression and evalv2 is correct.
At the very least, you can say the evalv3 behaviour is very inconsistent: If you change the _a+_b
to either just _a
or _b
then the default i: *0
isn't applied. By changing the embedding to the _a+_b
version, the default now is applied. This seems very unlikely to be the desired behaviour.
Additionally, I don't see why the default would be applied in this case at all -- by rule U1 of https://cuelang.org/docs/reference/spec/#default-values the default 0
should be being unified with the non-default 11
and that should turn into ⊥, thus ensuring the default never features subsequently.
This clearly is a bug in evalv3. Here is a smaller reproducer
a: {
1 + #b
#b: 10
}
a: *0 | number
The internal debugging info shows that the embedded scalar in a
gets dropped, which means that the default is not discarded.
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest stable release?
0.10.0 is latest.
What did you do?
What did you expect to see?
A passing test.
What did you see instead?