]> Cypherpunks.ru repositories - gostls13.git/commit
go/types: eliminate Named.instPos
authorRobert Findley <rfindley@google.com>
Fri, 10 Sep 2021 19:12:57 +0000 (15:12 -0400)
committerRobert Findley <rfindley@google.com>
Tue, 14 Sep 2021 23:35:36 +0000 (23:35 +0000)
commitbf26e43d0f9a6c9d43c206877917e66f0fc24a19
treea44f522477ab8238abec4ffc278bce5a07936a05
parent2933c451a06ee0f97a698d1383cfbda988374137
go/types: eliminate Named.instPos

We no longer need to use the nilness of Named.instPos to signal whether
instance expansion has occurred, so remove it from the Named struct by
instead closing over the instantiation position in the resolver.

This means we cannot print instance markers for unexpanded instances:
instances may escape the type checking pass without being fully
expanded, and we can not check whether they have been expanded in a
concurrency-safe way without introducing a more heavy-weight
syncronization mechanism.

With this change, instantiation should be concurrency safe, modulo bugs
of course as we have little test coverage of concurrency (see #47729).

Fixes #47910

Change-Id: Ifeef6df296f00105579554b333a44d08aae113c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/349411
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/internal/gcimporter/gcimporter_test.go
src/go/types/environment.go
src/go/types/errors.go
src/go/types/errors_test.go
src/go/types/instantiate.go
src/go/types/named.go
src/go/types/sizeof_test.go
src/go/types/subst.go
src/go/types/typestring.go