<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go-git.git/test/run.go, branch dev.typeparams</title>
<subtitle>github.com: golang/go
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/'/>
<entry>
<title>[dev.typeparams] cmd/compile: fixing case where type arg is an interface</title>
<updated>2021-08-05T17:33:41+00:00</updated>
<author>
<name>Dan Scales</name>
<email>danscales@google.com</email>
</author>
<published>2021-08-04T21:25:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=3cdf8b429e7550c04ab986327bf9aed8de08d6fa'/>
<id>3cdf8b429e7550c04ab986327bf9aed8de08d6fa</id>
<content type='text'>
In this case, we can't use an itab for doing a bound call, since we're
converting from an interface to an interface. We do a static or dynamic
type assert in new function assertToBound().

The dynamic type assert in assertToBound() is only needed if a bound is
parameterized. In that case, we must do a dynamic type assert, and
therefore need a dictionary entry for the type bound (see change in
getGfInfo). I'm not sure if we can somehow limit this case, since using
an interface as a type arg AND having the type bound of the type
arg be parameterized is a very unlikely case.

Had to add the TUNION case to parameterizedBy1() (which is only used for
extra checking).

Added a bunch of these test cases to 13.go, which now passes.

Change-Id: Ic22eed637fa879b5bbb46d36b40aaad6f90b9d01
Reviewed-on: https://go-review.googlesource.com/c/go/+/339898
Trust: Dan Scales &lt;danscales@google.com&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In this case, we can't use an itab for doing a bound call, since we're
converting from an interface to an interface. We do a static or dynamic
type assert in new function assertToBound().

The dynamic type assert in assertToBound() is only needed if a bound is
parameterized. In that case, we must do a dynamic type assert, and
therefore need a dictionary entry for the type bound (see change in
getGfInfo). I'm not sure if we can somehow limit this case, since using
an interface as a type arg AND having the type bound of the type
arg be parameterized is a very unlikely case.

Had to add the TUNION case to parameterizedBy1() (which is only used for
extra checking).

Added a bunch of these test cases to 13.go, which now passes.

Change-Id: Ic22eed637fa879b5bbb46d36b40aaad6f90b9d01
Reviewed-on: https://go-review.googlesource.com/c/go/+/339898
Trust: Dan Scales &lt;danscales@google.com&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[dev.typeparams] cmd/compile: mark methods of instantiated interface types as used</title>
<updated>2021-07-28T03:04:12+00:00</updated>
<author>
<name>Dan Scales</name>
<email>danscales@google.com</email>
</author>
<published>2021-07-26T01:27:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=e00a6ec084605b773cdb87971de5b5536c0cc13e'/>
<id>e00a6ec084605b773cdb87971de5b5536c0cc13e</id>
<content type='text'>
Fix the cons.go missing method error. Mark all the methods of
instantiated interface types as used. We could try to record all the
exact methods used for generic interface types, but for now, just mark
all the methods as used so that their methods are not dead-code
eliminated.

Change-Id: I35685eda82476244371379b97691a1b8506ef0f7
Reviewed-on: https://go-review.googlesource.com/c/go/+/337349
Trust: Dan Scales &lt;danscales@google.com&gt;
Run-TryBot: Dan Scales &lt;danscales@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix the cons.go missing method error. Mark all the methods of
instantiated interface types as used. We could try to record all the
exact methods used for generic interface types, but for now, just mark
all the methods as used so that their methods are not dead-code
eliminated.

Change-Id: I35685eda82476244371379b97691a1b8506ef0f7
Reviewed-on: https://go-review.googlesource.com/c/go/+/337349
Trust: Dan Scales &lt;danscales@google.com&gt;
Run-TryBot: Dan Scales &lt;danscales@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[dev.typeparams] cmd/compile/internal/types2: fix a bug in package qualification logic</title>
<updated>2021-07-26T20:53:13+00:00</updated>
<author>
<name>Robert Griesemer</name>
<email>gri@golang.org</email>
</author>
<published>2021-07-21T23:36:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=b93f646125882fc59a6dd5a9c83813dce674bc6b'/>
<id>b93f646125882fc59a6dd5a9c83813dce674bc6b</id>
<content type='text'>
This is a partial port of https://golang.org/cl/330629, containing
only the actual bug fix and adjustements to another test file.

The respective test case has not been ported yet as it requires
some bigger adjustments.

For #46905

Change-Id: Ibd20658b8a31855da20cf56e24bcce9560656ca0
Reviewed-on: https://go-review.googlesource.com/c/go/+/336350
Trust: Robert Griesemer &lt;gri@golang.org&gt;
Run-TryBot: Robert Griesemer &lt;gri@golang.org&gt;
Reviewed-by: Robert Findley &lt;rfindley@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a partial port of https://golang.org/cl/330629, containing
only the actual bug fix and adjustements to another test file.

The respective test case has not been ported yet as it requires
some bigger adjustments.

For #46905

Change-Id: Ibd20658b8a31855da20cf56e24bcce9560656ca0
Reviewed-on: https://go-review.googlesource.com/c/go/+/336350
Trust: Robert Griesemer &lt;gri@golang.org&gt;
Run-TryBot: Robert Griesemer &lt;gri@golang.org&gt;
Reviewed-by: Robert Findley &lt;rfindley@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[dev.typeparams] cmd/compile: fix unified IR support for //go:nointerface</title>
<updated>2021-07-26T18:43:12+00:00</updated>
<author>
<name>Matthew Dempsky</name>
<email>mdempsky@google.com</email>
</author>
<published>2021-07-02T23:59:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=bfcb7c4c8adadd6191c3fdacf2b59136b0da5c1c'/>
<id>bfcb7c4c8adadd6191c3fdacf2b59136b0da5c1c</id>
<content type='text'>
This CL changes fixedbugs/issue30862.go into a "runindir" test so that
it can use '-goexperiment fieldtrack' and test that //go:nointerface
works with cmd/compile. In particular, this revealed that -G=3 and
unified IR did not handle it correctly.

This CL also fixes unified IR's support for //go:nointerface and adds
a test that checks that //go:nointerface, promoted methods, and
generics all interact as expected.

Updates #47045.

Change-Id: Ib8acff8ae18bf124520d00c98e8915699cba2abd
Reviewed-on: https://go-review.googlesource.com/c/go/+/332611
Run-TryBot: Matthew Dempsky &lt;mdempsky@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Trust: Matthew Dempsky &lt;mdempsky@google.com&gt;
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This CL changes fixedbugs/issue30862.go into a "runindir" test so that
it can use '-goexperiment fieldtrack' and test that //go:nointerface
works with cmd/compile. In particular, this revealed that -G=3 and
unified IR did not handle it correctly.

This CL also fixes unified IR's support for //go:nointerface and adds
a test that checks that //go:nointerface, promoted methods, and
generics all interact as expected.

Updates #47045.

Change-Id: Ib8acff8ae18bf124520d00c98e8915699cba2abd
Reviewed-on: https://go-review.googlesource.com/c/go/+/332611
Run-TryBot: Matthew Dempsky &lt;mdempsky@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Trust: Matthew Dempsky &lt;mdempsky@google.com&gt;
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[dev.typeparams] transformDot() should set Selection and tc flag for added ODOTs</title>
<updated>2021-07-24T17:58:49+00:00</updated>
<author>
<name>Dan Scales</name>
<email>danscales@google.com</email>
</author>
<published>2021-07-18T18:10:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=a2e2b0362bb2e7b93de668007027d08888bc9a38'/>
<id>a2e2b0362bb2e7b93de668007027d08888bc9a38</id>
<content type='text'>
Fixes -G=3 issue with issue44688.go.

Change-Id: Ie98c0cbd48683dedd115332043f14c8f3160f46c
Reviewed-on: https://go-review.googlesource.com/c/go/+/337029
Run-TryBot: Dan Scales &lt;danscales@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
Trust: Dan Scales &lt;danscales@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes -G=3 issue with issue44688.go.

Change-Id: Ie98c0cbd48683dedd115332043f14c8f3160f46c
Reviewed-on: https://go-review.googlesource.com/c/go/+/337029
Run-TryBot: Dan Scales &lt;danscales@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
Trust: Dan Scales &lt;danscales@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[dev.typeparams] cmd/compile: add dictionary entries for itab conversion</title>
<updated>2021-07-23T21:16:54+00:00</updated>
<author>
<name>Dan Scales</name>
<email>danscales@google.com</email>
</author>
<published>2021-07-13T02:34:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=02c01725002a73739cefbc9fcf2575469be6da13'/>
<id>02c01725002a73739cefbc9fcf2575469be6da13</id>
<content type='text'>
This fix the case where a type param or derived type is converted to a
non-empty interface. Previously, we were converting to an empty
interface and then using DOTTYPE to convert to the correct non-empty
interface. In that case, we can get the needed itab directly from the
dictionary. This is needed for correctness from shapes, if the
destination interface is parameterized, else we will incorrectly convert
to the shape version of the interface.

Creating/writing an itab can involve generating wrappers for a bunch of
methods, which may use dictionaries. So, all the
dictionaries/instantiations are being generated on the fly and have
recursive relationships, it is simplest to finish creating/writing the
itabs at the end of the stenciling phase. So, we create a list of the
dictionaries which need to be completed by writing out their itab
entries.

The existing tests ordered.go, ifaceconv.go, and issue44688.go make use
of this optimization.

Got itab conversions for bound calls working, except for 13.go.
Also, want to get rid of the concretify, but I think we need more info
on the Bound from types2.

Change-Id: If552958a7b8a435500d6cc42c401572c367b30d1
Reviewed-on: https://go-review.googlesource.com/c/go/+/336993
Trust: Dan Scales &lt;danscales@google.com&gt;
Run-TryBot: Dan Scales &lt;danscales@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fix the case where a type param or derived type is converted to a
non-empty interface. Previously, we were converting to an empty
interface and then using DOTTYPE to convert to the correct non-empty
interface. In that case, we can get the needed itab directly from the
dictionary. This is needed for correctness from shapes, if the
destination interface is parameterized, else we will incorrectly convert
to the shape version of the interface.

Creating/writing an itab can involve generating wrappers for a bunch of
methods, which may use dictionaries. So, all the
dictionaries/instantiations are being generated on the fly and have
recursive relationships, it is simplest to finish creating/writing the
itabs at the end of the stenciling phase. So, we create a list of the
dictionaries which need to be completed by writing out their itab
entries.

The existing tests ordered.go, ifaceconv.go, and issue44688.go make use
of this optimization.

Got itab conversions for bound calls working, except for 13.go.
Also, want to get rid of the concretify, but I think we need more info
on the Bound from types2.

Change-Id: If552958a7b8a435500d6cc42c401572c367b30d1
Reviewed-on: https://go-review.googlesource.com/c/go/+/336993
Trust: Dan Scales &lt;danscales@google.com&gt;
Run-TryBot: Dan Scales &lt;danscales@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[dev.typeparams] test: cleanup 'go env' and -goexperiment</title>
<updated>2021-07-22T17:01:49+00:00</updated>
<author>
<name>Matthew Dempsky</name>
<email>mdempsky@google.com</email>
</author>
<published>2021-07-02T22:42:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=311baf65f49f4b15396f7e88c05bc97d47f2e4ed'/>
<id>311baf65f49f4b15396f7e88c05bc97d47f2e4ed</id>
<content type='text'>
This CL makes two related changes:

1. It uses 'go env -json' to query the environment configuration,
rather than attempting to manually reconstruct the values that cmd/go
is going to use.

2. It changes the -goexperiment flag to *extend* any ambient
GOEXPERIMENT configuration. Notably, this means that '-goexperiment
fieldtrack' now tests fieldtracking in conjunction with any other
experiments (e.g., unified IR). Tests that want to test an exact
GOEXPERIMENT config should use '-goexperiment none,foo' instead.

Change-Id: I96a97198209e540e934fe7035110c3ae3a8f0e6a
Reviewed-on: https://go-review.googlesource.com/c/go/+/332610
Trust: Matthew Dempsky &lt;mdempsky@google.com&gt;
Run-TryBot: Matthew Dempsky &lt;mdempsky@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This CL makes two related changes:

1. It uses 'go env -json' to query the environment configuration,
rather than attempting to manually reconstruct the values that cmd/go
is going to use.

2. It changes the -goexperiment flag to *extend* any ambient
GOEXPERIMENT configuration. Notably, this means that '-goexperiment
fieldtrack' now tests fieldtracking in conjunction with any other
experiments (e.g., unified IR). Tests that want to test an exact
GOEXPERIMENT config should use '-goexperiment none,foo' instead.

Change-Id: I96a97198209e540e934fe7035110c3ae3a8f0e6a
Reviewed-on: https://go-review.googlesource.com/c/go/+/332610
Trust: Matthew Dempsky &lt;mdempsky@google.com&gt;
Run-TryBot: Matthew Dempsky &lt;mdempsky@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[dev.typeparams] Fix problem with 14.go</title>
<updated>2021-07-22T04:45:49+00:00</updated>
<author>
<name>Dan Scales</name>
<email>danscales@google.com</email>
</author>
<published>2021-07-19T19:41:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=8e9109e95a8c4be92ba018a1353104706acf8466'/>
<id>8e9109e95a8c4be92ba018a1353104706acf8466</id>
<content type='text'>
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 &lt;danscales@google.com&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;danscales@google.com&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[dev.typeparams] Get dictionaryCapture.go working.</title>
<updated>2021-07-22T04:44:48+00:00</updated>
<author>
<name>Dan Scales</name>
<email>danscales@google.com</email>
</author>
<published>2021-07-18T18:09:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=ee20dff27debb738ca3a89a7a30113771c1c078f'/>
<id>ee20dff27debb738ca3a89a7a30113771c1c078f</id>
<content type='text'>
METHVALUE in a generic function (that is not called) was not causing
buildClosure() to be called and therefore not using dictionaries. Also,
had to add an extra check to make sure that if we have a FUNCINST
node above a METHVALUE, we only call buildClosure once.

Change-Id: I49756152fc343e5ac1c449e697960fc2a0f482ae
Reviewed-on: https://go-review.googlesource.com/c/go/+/336429
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
Trust: Dan Scales &lt;danscales@google.com&gt;
Run-TryBot: Dan Scales &lt;danscales@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
METHVALUE in a generic function (that is not called) was not causing
buildClosure() to be called and therefore not using dictionaries. Also,
had to add an extra check to make sure that if we have a FUNCINST
node above a METHVALUE, we only call buildClosure once.

Change-Id: I49756152fc343e5ac1c449e697960fc2a0f482ae
Reviewed-on: https://go-review.googlesource.com/c/go/+/336429
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
Trust: Dan Scales &lt;danscales@google.com&gt;
Run-TryBot: Dan Scales &lt;danscales@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[dev.typeparams] cmd/compile: disable failing generic tests</title>
<updated>2021-07-21T21:04:29+00:00</updated>
<author>
<name>Keith Randall</name>
<email>khr@golang.org</email>
</author>
<published>2021-07-19T23:49:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=73af5f718f6012c0a76cabd43c91505d5a80c169'/>
<id>73af5f718f6012c0a76cabd43c91505d5a80c169</id>
<content type='text'>
We'll have to revisit eventually, but disabling for now.

Change-Id: Ic34cfe451939d61884079bb125b9290db1e05e47
Reviewed-on: https://go-review.googlesource.com/c/go/+/335829
Run-TryBot: Keith Randall &lt;khr@golang.org&gt;
Trust: Keith Randall &lt;khr@golang.org&gt;
Trust: Dan Scales &lt;danscales@google.com&gt;
Reviewed-by: Dan Scales &lt;danscales@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We'll have to revisit eventually, but disabling for now.

Change-Id: Ic34cfe451939d61884079bb125b9290db1e05e47
Reviewed-on: https://go-review.googlesource.com/c/go/+/335829
Run-TryBot: Keith Randall &lt;khr@golang.org&gt;
Trust: Keith Randall &lt;khr@golang.org&gt;
Trust: Dan Scales &lt;danscales@google.com&gt;
Reviewed-by: Dan Scales &lt;danscales@google.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
