Skip to content

Commit b7d24b8

Browse files
committed
cue/errors: always add error
If this is a duplicate, it will be removed later. Change-Id: I2a20418e2a8c4bcd7042a543f69082298212b99f Reviewed-on: https://cue-review.googlesource.com/c/cue/+/2541 Reviewed-by: Marcel van Lohuizen <[email protected]>
1 parent 74c19ff commit b7d24b8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

cue/ast.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@ func (inst *Instance) insertFile(f *ast.File) errors.Error {
4545
// inserting. For now, we accept errors that did not make it up to the tree.
4646
result := v.walk(f)
4747
if isBottom(result) {
48-
if v.errors != nil {
49-
return v.errors
50-
}
51-
v := newValueRoot(v.ctx(), result)
52-
return v.toErr(result.(*bottom))
48+
val := newValueRoot(v.ctx(), result)
49+
v.errors = errors.Append(v.errors, val.toErr(result.(*bottom)))
50+
return v.errors
5351
}
5452

5553
return nil

0 commit comments

Comments
 (0)