]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix TypeDefn to deal with node with no Ntype set
authorDan Scales <danscales@google.com>
Thu, 4 Nov 2021 18:59:17 +0000 (11:59 -0700)
committerDan Scales <danscales@google.com>
Thu, 4 Nov 2021 20:24:01 +0000 (20:24 +0000)
commit99699d14fe538f6886948ee6d3cc57f7f2a9bff7
tree07c1a20f8d27a941761b37f4646e176acd60e282
parent6d1fffac6388d965616520eb23f36885760d5b66
cmd/compile: fix TypeDefn to deal with node with no Ntype set

Adjust TypeDefn(), which is used by reportTypeLoop(), to work for nodes
with no Ntype set (which are all nodes in -G=3 mode). Normally,
reportTypeLoop() would not be called, because the types2 typechecker
would have already caught it. This is a possible way to report an
unusual type loop involving type params, which is not being caught by
the types2 type checker.

Updates #48962

Change-Id: I55edee46026eece2e8647c5b5b4d8dfb39eeb5f8
Reviewed-on: https://go-review.googlesource.com/c/go/+/361398
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/ir/name.go
test/typeparam/issue48962.go [new file with mode: 0644]