Skip to content

Commit 4b8b2c5

Browse files
committed
cmd/compile: do not set type for OTYPE
That's an invalid operation and depend on gc.hidePanic to report error. Updates #43311 Change-Id: Ib0761dcf4d9d2a23c41de7eff0376677a90b942e Reviewed-on: https://go-review.googlesource.com/c/go/+/294033 Trust: Cuong Manh Le <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]>
1 parent 8c22874 commit 4b8b2c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/compile/internal/typecheck/typecheck.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ func typecheck(n ir.Node, top int) (res ir.Node) {
433433
case top&ctxType == 0 && n.Op() == ir.OTYPE && t != nil:
434434
if !n.Type().Broke() {
435435
base.Errorf("type %v is not an expression", n.Type())
436+
n.SetDiag(true)
436437
}
437-
n.SetType(nil)
438438

439439
case top&(ctxStmt|ctxExpr) == ctxStmt && !isStmt && t != nil:
440440
if !n.Diag() {

0 commit comments

Comments
 (0)