1
0
mirror of https://github.com/golang/go synced 2024-11-22 20:40:03 -07:00

cmd/compile: do not set type for OPACK

That's an invalid operation and depend on gc.hidePanic to report error.

Updates #43311

Change-Id: I78d615c40ab1e7887f612491e215c1c2bb758ef6
Reviewed-on: https://go-review.googlesource.com/c/go/+/294031
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Cuong Manh Le 2021-02-19 13:54:28 +07:00
parent b7f4307761
commit 12a405b96a

View File

@ -528,7 +528,7 @@ func typecheck1(n ir.Node, top int) ir.Node {
case ir.OPACK:
n := n.(*ir.PkgName)
base.Errorf("use of package %v without selector", n.Sym())
n.SetType(nil)
n.SetDiag(true)
return n
// types (ODEREF is with exprs)