aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-03-23 12:03:51 -0700
committerRobert Griesemer <gri@golang.org>2021-03-25 04:14:58 +0000
commitddcdbb417b47e50fc7006c9438104c5b8b5f75e4 (patch)
treee06baf22418606b88c97212a9d8b7befcf003817 /src
parent607f99904e3f5565517eee452d9153a634a66369 (diff)
downloadgo-ddcdbb417b47e50fc7006c9438104c5b8b5f75e4.tar.xz
cmd/compile/internal/types2: review of assignments.go
The changes between (equivalent, and reviewed) go/types/assignments.go and assignments.go can be seen by comparing patchset 1 and 2. The actual changes are removing the "// UNREVIEWED" marker. The primary differences to go/types/assignments.go are: - use of syntax instead of go/ast package - no reporting of error codes (for now) - different handling of nil values (we can't use Typ[UntypedNil] to represent an untyped nil because types2 gives such nil values context-dependent types) Change-Id: I5d8a58f43ca8ed2daa060c46842a6ebc11b3cb35 Reviewed-on: https://go-review.googlesource.com/c/go/+/304051 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/types2/assignments.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types2/assignments.go b/src/cmd/compile/internal/types2/assignments.go
index 272e2fee6e..b8cf46c364 100644
--- a/src/cmd/compile/internal/types2/assignments.go
+++ b/src/cmd/compile/internal/types2/assignments.go
@@ -1,4 +1,3 @@
-// UNREVIEWED
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@@ -131,6 +130,8 @@ func (check *Checker) initVar(lhs *Var, x *operand, context string) Type {
if lhs.typ == nil {
lhs.typ = Typ[Invalid]
}
+ // Note: This was reverted in go/types (https://golang.org/cl/292751).
+ // TODO(gri): decide what to do (also affects test/run.go exclusion list)
lhs.used = true // avoid follow-on "declared but not used" errors
return nil
}