]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] go/types, types2: set tset when constructing interfaces in the universe
authorRob Findley <rfindley@google.com>
Fri, 23 Jul 2021 14:00:10 +0000 (10:00 -0400)
committerRobert Findley <rfindley@google.com>
Sat, 24 Jul 2021 01:54:15 +0000 (01:54 +0000)
commit9f928f9318efb9e6a9d45e7ed959afaaee4b7315
tree6c6d416469abab2da3bdf6f9ac030cfa17a7eb7a
parent6992dcdad9b94a2b33b957474ef0eb210d563a40
[dev.typeparams] go/types, types2: set tset when constructing interfaces in the universe

As of CL 334894, type sets are lazily evaluated on interfaces. For the
universe interfaces error and comparable, this can lead to data races
when type checking concurrently. Fix this by computing their type set
when they are defined.

Tested using the repro from #47345. I considered checking this in as a
test, but it probably wouldn't add much value going forward.

Fixes #47345

Change-Id: I014a511b8e3c092c86201a8bfc7f5f494f8f20e8
Reviewed-on: https://go-review.googlesource.com/c/go/+/336910
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/types2/universe.go
src/go/types/universe.go