go/test/typeparam/mdempsky
Dan Scales 8e9109e95a [dev.typeparams] Fix problem with 14.go
Removed a case in transformCall() where we were setting a type on n,
which isn't needed, since noder2 already set the type of n. More
importantly, we are losing information, since the type of the results
may be a shape type, but the actual type of call is the known type
from types2, which may be a concrete type (in this case Zero[MyInt]).
That concrete type will then be used correctly if the concrete result is
converted to an interface.

If we are inlining the call to Zero[MyInt], we need to add an implicit
CONVNOP operation, since we are going to use the result variable
directly, which has a shape type. So, add an implicit CONVNOP to
remember that the known type is the concrete type.

Also cleaned up 14.go a bit, so it is more understandable. Renamed type
T to AnyInt, since T is used elsewhere as a type parameter. Reformatted
Zero function and added a comment.

Change-Id: Id917a2e054e0bbae9bd302232853fa8741d49b64
Reviewed-on: https://go-review.googlesource.com/c/go/+/336430
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2021-07-22 04:45:49 +00:00
..
1.dir [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
3.dir [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
4.dir [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
7.dir [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
8.dir [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
10.dir [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
12.dir [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
1.go [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
2.go [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
3.go [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
4.go [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
5.go [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
6.go [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
7.go [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
8.go [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
9.go [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
10.go [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
11.go [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
12.go [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
13.go [dev.typeparams] test: add regress tests that fail(ed) with -G=3 2021-07-07 11:12:24 +00:00
14.go [dev.typeparams] Fix problem with 14.go 2021-07-22 04:45:49 +00:00