summaryrefslogtreecommitdiff
path: root/test/typeparam/issue50841.go
Commit message (Collapse)AuthorAgeFilesLines
* all: avoid use of cmd/compile -G flag in testsMatthew Dempsky2022-03-011-1/+1
| | | | | | | | | | | | The next CL will remove the -G flag, effectively hard-coding it to its current default (-G=3). Change-Id: Ib4743b529206928f9f1cca9fdb19989728327831 Reviewed-on: https://go-review.googlesource.com/c/go/+/388534 Reviewed-by: Keith Randall <khr@golang.org> Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
* cmd/compile: add missing shape check in (*Tsubster).tinterDan Scales2022-01-271-0/+7
Add a missing shape check in (*Tsubster).tinter when substituting on a generic type which is an empty interface, analogous to same check in (*Tsubster).tstruct. Empty structs/interfaces that have rparams (i.e. are a generic type or a shape type) need to get a new type of their rparams - they will be different even though they don't have any fields/methods. Without this shape check, we were not correctly completing the Token[int] type during substitution in the example in the issue. This issue only happens for a generic type which is an empty interface (i.e. doesn't actually use the type param, hence quite unusual). Added the test case already created by Keith. Fixes #50841 Change-Id: Ia985b9f52c0e87ed0647b46373e44c51cb748ba4 Reviewed-on: https://go-review.googlesource.com/c/go/+/381175 Trust: Dan Scales <danscales@google.com> Run-TryBot: Dan Scales <danscales@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>