]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: replace Type.OrigSym with Type.OrigType
authorMatthew Dempsky <mdempsky@google.com>
Mon, 21 Mar 2022 17:06:48 +0000 (10:06 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 21 Mar 2022 21:57:24 +0000 (21:57 +0000)
commitadae6ec542c3287ffe643093a0f61c9871f4e238
treea6feb8519edb0d0558d70b3c21b9e2854dbd363a
parent29866aa2b6a6a48672a386d05b53779e768c13d6
cmd/compile: replace Type.OrigSym with Type.OrigType

First law of cmd/compile frontend development: thou shalt not rely on
types.Sym.

This CL replaces Type.OrigSym with Type.OrigType, which semantically
matches what all of the uses within the frontend actually care about,
and avoids using types.Sym, which invariably leads to mistakes because
symbol scoping in the frontend doesn't work how anyone intuitively
expects it to.

Fixes #51765.

Change-Id: I4affe6ee0718103ce5006ab68aa7e1bb0cac6881
Reviewed-on: https://go-review.googlesource.com/c/go/+/394274
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/noder/decl.go
src/cmd/compile/internal/noder/stencil.go
src/cmd/compile/internal/noder/types.go
src/cmd/compile/internal/reflectdata/reflect.go
src/cmd/compile/internal/typecheck/crawler.go
src/cmd/compile/internal/typecheck/iexport.go
src/cmd/compile/internal/typecheck/iimport.go
src/cmd/compile/internal/typecheck/subr.go
src/cmd/compile/internal/types/type.go
test/typeparam/issue51765.go [new file with mode: 0644]