From: Cuong Manh Le Date: Fri, 19 Feb 2021 06:54:28 +0000 (+0700) Subject: cmd/compile: do not set type for OPACK X-Git-Tag: go1.17beta1~1295 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=12a405b96a;p=gostls13.git 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 Run-TryBot: Cuong Manh Le TryBot-Result: Go Bot Reviewed-by: Matthew Dempsky --- diff --git a/src/cmd/compile/internal/typecheck/typecheck.go b/src/cmd/compile/internal/typecheck/typecheck.go index 5a3446b358..278e64fc61 100644 --- a/src/cmd/compile/internal/typecheck/typecheck.go +++ b/src/cmd/compile/internal/typecheck/typecheck.go @@ -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)