]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/types2: print "nil" rather than "untyped nil"
authorRobert Griesemer <gri@golang.org>
Mon, 22 Nov 2021 21:53:21 +0000 (13:53 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 22 Nov 2021 23:51:43 +0000 (23:51 +0000)
commit83bfed916b97d51646b4bdc95e0e0fd7798b754f
tree775b75127541e7c6c294634682540180326cf0bf
parent9678f794149d07857cbf2a518bfc7aec532fb732
cmd/compile/internal/types2: print "nil" rather than "untyped nil"

When we have a typed nil, we already say so; thus it is sufficient
to use "nil" in all the other cases.

This is closer to (1.17) compiler behavior. In cases where the
1.17 compiler prints "untyped nil" (e.g., wrong uses of "copy"),
we already print a different message. We can do better in those
cases as well; will be addressed in a separate CL (see #49735).

Fixes #48852.

Change-Id: I9a7a72e0f99185b00f80040c5510a693b1ea80f6
Reviewed-on: https://go-review.googlesource.com/c/go/+/366276
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/assignments.go
src/cmd/compile/internal/types2/operand.go
src/cmd/compile/internal/types2/testdata/check/stmt0.src
src/cmd/compile/internal/types2/testdata/fixedbugs/issue49296.go2
src/cmd/compile/internal/types2/testdata/spec/assignability.go2
test/fixedbugs/issue6004.go
test/fixedbugs/issue6402.go
test/fixedbugs/issue7223.go