this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/core/adt: find late-stage conflict errors

Changing the test of 2481 from using a let to using
a field exposes this issue.

Issue #2481

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: Ia12c76f089f3c9c1ed64af9e21f3224e6f1a990b
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/557022
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>

+14 -6
+9 -3
cue/testdata/comprehensions/issue2481.txtar
··· 81 81 Conjuncts: 48 82 82 Disjuncts: 55 83 83 -- out/eval -- 84 - (struct){ 84 + Errors: 85 + out: cannot combine regular field "val" with "b": 86 + ./in.cue:33:2 87 + 88 + Result: 89 + (_|_){ 90 + // [eval] 85 91 out: (_|_){ 86 - // [cycle] out: circular dependency in evaluation of conditionals: val changed after evaluation: 87 - // ./in.cue:8:7 92 + // [eval] out: cannot combine regular field "val" with "b": 93 + // ./in.cue:33:2 88 94 val: (string){ "b" } 89 95 } 90 96 multiLets: (_|_){
+5 -3
internal/core/adt/eval.go
··· 814 814 k++ 815 815 816 816 switch { 817 - case !wasVoid, !a.Label.IsString(): 817 + case a.ArcType > ArcRequired, !a.Label.IsString(): 818 818 case n.kind&StructKind == 0: 819 - n.reportFieldMismatch(pos(a.Value()), nil, a.Label, n.node.Value()) 820 - 819 + if !n.node.IsErr() { 820 + n.reportFieldMismatch(pos(a.Value()), nil, a.Label, n.node.Value()) 821 + } 822 + case !wasVoid: 821 823 case n.kind == TopKind: 822 824 // Theoretically it may be possible that a "void" arc references 823 825 // this top value where it really should have been a struct. One