]> Cypherpunks.ru repositories - gostls13.git/commit
go/types: check if the interface is already complete in Complete
authorRobert Findley <rfindley@google.com>
Tue, 17 Aug 2021 00:13:25 +0000 (20:13 -0400)
committerRobert Findley <rfindley@google.com>
Tue, 17 Aug 2021 02:50:08 +0000 (02:50 +0000)
commit29ec74fb82328f4c005d556291ea687da7aad4b0
treeef2b1fd4c6f9791f2d9acdb50ad5e6fcd46ebc3d
parent91a935ea0f525c04016dd37c45143af942ffd3fc
go/types: check if the interface is already complete in Complete

Once Interfaces have been completed they must never be written again,
as they may be used concurrently.

Avoid writing Interface.complete unnecessarily in Complete. Also, update
documentation to reflect that Complete must be called before the
Interface may be considered safe for concurrent use.

For #47726

Change-Id: Ic9fd1395ab0dd6d3499f7a698dadf315abcddab8
Reviewed-on: https://go-review.googlesource.com/c/go/+/342749
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/types/interface.go