aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/noder/noder.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-09-29 20:56:36 -0700
committerRobert Griesemer <gri@golang.org>2021-10-01 17:18:34 +0000
commitdab16c1c90626ca6c9704959500f120fd09546e6 (patch)
treec8ce62f8ae4d74ae478f5bb7825279f4db1431f8 /src/cmd/compile/internal/noder/noder.go
parent5279e534b5ced1eaea19e8b75968498287ff6228 (diff)
downloadgo-dab16c1c90626ca6c9704959500f120fd09546e6.tar.xz
cmd/compile/internal/types2: accept constraint literals with elided interfaces
When collecting type parameters, wrap constraint literals of the form ~T or A|B into interfaces so the type checker doesn't have to deal with these type set expressions syntactically anywhere else but in interfaces (i.e., union types continue to appear only as embedded elements in interfaces). Since a type constraint doesn't need to be an interface anymore, we can remove the respective restriction. Instead, when accessing the constraint interface via TypeParam.iface, wrap non-interface constraints at that point and update the constraint so it happens only once. By computing the types sets of all type parameters at before the end of type-checking, we ensure that type constraints are in their final form when accessed through the API. For #48424. Change-Id: I3a47a644ad4ab20f91d93ee39fcf3214bb5a81f9 Reviewed-on: https://go-review.googlesource.com/c/go/+/353139 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/noder/noder.go')
0 files changed, 0 insertions, 0 deletions