]> Cypherpunks repositories - gostls13.git/commit
go/types: ensure that constructed type parameters are immutable
authorRobert Findley <rfindley@google.com>
Mon, 29 Nov 2021 19:52:54 +0000 (14:52 -0500)
committerRobert Findley <rfindley@google.com>
Mon, 29 Nov 2021 22:25:04 +0000 (22:25 +0000)
commit186f375ecfdd0f9eae109464a93bb0ba8c993f45
treeec50b62401ec13c62074c8102e569c8672319b72
parentc402d64f37f819b0f2d9949c6895e342191d11d6
go/types: ensure that constructed type parameters are immutable

TypeParam.iface may mutate TypeParam.bound in the event that the type
parameter bound is not an interface.

Ensure that iface() is called before the type-checking pass returns, and
before NewTypeParam or TypeParam.SetConstraint exits.

Fixes #49788

Change-Id: I72279acf5f0223161671c04887bc2c3df4158927
Reviewed-on: https://go-review.googlesource.com/c/go/+/367614
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/cmd/compile/internal/types2/typeparam.go
src/go/types/typeparam.go