1
0
mirror of https://github.com/golang/go synced 2024-09-30 09:18:35 -06:00
Commit Graph

2 Commits

Author SHA1 Message Date
Bryan C. Mills
7286502b0d test/fixedbugs: fix issue48784.go to pass with -G=0
This test is currently failing in the longtest builders.

I do not know how or why the builders are adding the -G=0 parameter.

Updates #48784

Change-Id: I62248d3fbc47567a8c73b4868a2d4aeb0bc47bc3
Reviewed-on: https://go-review.googlesource.com/c/go/+/354631
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-10-07 18:58:33 +00:00
Cuong Manh Le
375a1fba0e cmd/compile: better error message for invalid untyped nil conversion
In case of an invalid untyped nil conversion, the compiler's original
type checker leaves it to the caller to report a suitable error message.
But types2 does not, it always reports the invalid conversion.

CL 328053 made types2 report a better error message, and match the
original compiler behavior. But it ignored the case of untyped nil.

This CL adds that missing case, by checking whether the two operands can
be mixed when untyped nil is present.

Fixes #48784

Change-Id: Idc7d86eb0245aa18ca428e278f4416d6b3679058
Reviewed-on: https://go-review.googlesource.com/c/go/+/354049
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-10-07 14:37:36 +00:00