Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/vet: bool checker issues a triangular number of errors #28086
The vet command's bool checker reports progressively more errors as the redundancy in an expression grows. For 7 copies, it reports 1+2+3+4+5+6 errors, because it reports all the errors in each subtree.
In realistic cases the redundancy is always n=2 so vet only prints n(n-1)/2 = 1 error and there's no problem in practice. However, vet's test suite exercises deeper expressions that lead to redundant errors that are ignored by vet's current test harness because they all match the correct regexp. The new x/tools/go/analysis test harness is more precise and requires multiple expectations for multiple errors. I do not wish to change the checker logic during the migration to the new API, so the task of this issue is to fix the checker logic and remove the workaround from the tests.