]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: do not set type for OPACK
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 19 Feb 2021 06:54:28 +0000 (13:54 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 4 Mar 2021 06:35:58 +0000 (06:35 +0000)
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>
src/cmd/compile/internal/typecheck/typecheck.go

index 5a3446b358f02adb5cf17fa23bdef42def40b1d0..278e64fc61a4cc9c307aaaad34ca9f2ab5643df3 100644 (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)