From 12a405b96aadc0174d3b63e61f593bcc28465af0 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Fri, 19 Feb 2021 13:54:28 +0700 Subject: [PATCH] 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 --- src/cmd/compile/internal/typecheck/typecheck.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/typecheck/typecheck.go b/src/cmd/compile/internal/typecheck/typecheck.go index 5a3446b358f..278e64fc61a 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)