Join GitHub today
cmd/compile: add error if unsigned tested for negativity #22844
What version of Go are you using (
This has been proposed (and rejected) in the past.
Initially, the proposal said
but the commenters agreed that a vet check might be more appropriate (see the discussion on the linked issue for more details).
Someone sent a change to add a vet check, but it wasn't merged. Apparently, it didn't satisfy the 3 vet requirements (correctness, precision, frequency).
Anyway, that was about vet. It seems like everyone agreed not to make this a compile error.