]> Cypherpunks.ru repositories - gostls13.git/commit
go/types, types2: avoid sorting all errors when matching errors
authorRobert Griesemer <gri@golang.org>
Thu, 8 Dec 2022 19:26:11 +0000 (11:26 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 17 Jan 2023 19:53:54 +0000 (19:53 +0000)
commit3af3810a3eeef49890b3cffb8d3f2a491f1b1b35
treead1fe514fd7c49368270e0d788295c6cc1491c71
parent390eee7ab18a091662fd7580b08b4aa3515b5951
go/types, types2: avoid sorting all errors when matching errors

Sorting is only needed if there are multiple matching errors on
the same line. Instead, in that rare case, select the error that
is closest.

Follow-up on CL 456137.

Change-Id: Ia2056b21c629f3a42495e32de89607fbefb82fa7
Reviewed-on: https://go-review.googlesource.com/c/go/+/456335
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
src/cmd/compile/internal/types2/check_test.go
src/go/types/check_test.go