]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] go/types: merge instance and Named to eliminate sanitization
authorRob Findley <rfindley@google.com>
Mon, 19 Jul 2021 17:11:50 +0000 (13:11 -0400)
committerRobert Findley <rfindley@google.com>
Thu, 22 Jul 2021 14:00:49 +0000 (14:00 +0000)
commit61f69d2559a1177c23dea06343a4784514e8dd85
tree587c43a77f6343a71ac267eb92be062dcf7fbac0
parent8e9109e95a8c4be92ba018a1353104706acf8466
[dev.typeparams] go/types: merge instance and Named to eliminate sanitization

Storing temporary syntactic information using an *instance type forces
us to be careful not to leak references to *instance in the checker
output. This is complex and error prone, as types are written in many
places during type checking.

Instead, temporarily pin the necessary syntactic information directly to
the Named type during the type checking pass. This allows us to avoid
having to sanitize references.

This includes a couple of small, unrelated changes that were made in the
process of debugging:
 - eliminate the expandf indirection: it is no longer necessary
 - include type parameters when printing objects

For #46151

Change-Id: I767e35b289f2fea512a168997af0f861cd242175
Reviewed-on: https://go-review.googlesource.com/c/go/+/335929
Trust: Robert Findley <rfindley@google.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
15 files changed:
src/go/types/check.go
src/go/types/decl.go
src/go/types/infer.go
src/go/types/instance.go
src/go/types/instantiate.go
src/go/types/named.go
src/go/types/object.go
src/go/types/predicates.go
src/go/types/sanitize.go [deleted file]
src/go/types/sizeof_test.go
src/go/types/subst.go
src/go/types/testdata/check/issues.go2
src/go/types/typeparam.go
src/go/types/typestring.go
src/go/types/typexpr.go