]> Cypherpunks repositories - gostls13.git/commitdiff
internal/types: fix the iota value in error code declarations
authorRobert Findley <rfindley@google.com>
Thu, 10 Nov 2022 16:15:26 +0000 (11:15 -0500)
committerGopher Robot <gobot@golang.org>
Thu, 10 Nov 2022 16:34:05 +0000 (16:34 +0000)
The new "InvalidSyntaxTree" node in the error code declaration
inadvertently incremented the value of iota by 1. Fix this by moving it
to its own declaration.

Change-Id: I34b33a8caddbbb9e41f431321ec0e5863dc15055
Reviewed-on: https://go-review.googlesource.com/c/go/+/449475
Run-TryBot: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/internal/types/errors/codes.go

index 8c0273571f1663a15eff8d408ea46b2526682cb4..7bf7b218bd719f3b5e502618573fe407d3c921c7 100644 (file)
@@ -34,7 +34,9 @@ const (
        // InvalidSyntaxTree occurs if an invalid syntax tree is provided
        // to the type checker. It should never happen.
        InvalidSyntaxTree Code = -1
+)
 
+const (
        // The zero Code value indicates an unset (invalid) error code.
        _ Code = iota