]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove spurious ir.Dump
authorMatthew Dempsky <mdempsky@google.com>
Fri, 4 Jun 2021 01:00:53 +0000 (18:00 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 4 Jun 2021 01:26:43 +0000 (01:26 +0000)
This ir.Dump call is a debugging artifact introduced in
golang.org/cl/274103, which should never be printed for valid,
non-generic code, but evidently can now sometimes appear due to how
the parser handles invalid syntax.

The parser should probably not recognize "x[2]" as a type expression
in non-generics mode, but also probably we shouldn't try noding after
reporting syntax errors. Either way, this diagnostic has outlived its
usefulness, and noder's days are numbered anyway, so we might as well
just remove it to save end users any confusion.

Updates #46558.

Change-Id: Ib68502ef834d610b883c2f2bb11d9b385bc66e37
Reviewed-on: https://go-review.googlesource.com/c/go/+/324991
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>

src/cmd/compile/internal/noder/noder.go

index 4c7c9fc322f97726ceabf3368dc2fd906a20e606..5fcad096c28ae5f5aa413bfc1a0ead3f7212e630 100644 (file)
@@ -882,9 +882,6 @@ func (p *noder) typeExpr(typ syntax.Expr) ir.Ntype {
        if n == nil {
                return nil
        }
-       if _, ok := n.(ir.Ntype); !ok {
-               ir.Dump("NOT NTYPE", n)
-       }
        return n.(ir.Ntype)
 }