core/adt: identify duplicate errors when pairwise-combining
Revert cue/errors/errors.go to before
https://review.gerrithub.io/c/cue-lang/cue/+/1199401
The previous attempt to fix this issue was extremely fragile: it only
worked if there was an attempt to append the exact same error
contiguously. In practice we have seen that this may not happen,
rendering that fix ineffective. So it is reverted here.
By contrast, in core/adt *OpContext.node(), it can be the case that the
call to unifyNode returns the opContext's own errors. The subsequent
call to *OpContext.AddBottom() and CombineErrors() can therefore result
in the duplication of the opContext's errors. Identifying and solving
this in CombineErrors() seems to be a robust solution.
Fixes #3307
Signed-off-by: Matthew Sackman <matthew@cue.works>
Change-Id: Ib3a0bff023343d410273017ea24e92d54346d77c
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1199723
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@gmail.com>