<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/test/interface/pointer.go, branch makepkg</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=makepkg</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=makepkg'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2023-03-28T14:28:33Z</updated>
<entry>
<title>go/types, types2: more systematic use of Checker.use und useLHS</title>
<updated>2023-03-28T14:28:33Z</updated>
<author>
<name>Robert Griesemer</name>
<email>gri@golang.org</email>
</author>
<published>2023-03-22T18:59:39Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=abf9b112fd12e05da2d064554d51d140c2871741'/>
<id>urn:sha1:abf9b112fd12e05da2d064554d51d140c2871741</id>
<content type='text'>
This CL re-introduces useLHS because we don't want to suppress
correct "declared but not used" errors for variables that only
appear on the LHS of an assignment (using Checker.use would mark
them as used).

This CL also adjusts a couple of places where types2 differed
from go/types (and suppressed valid "declared and not used"
errors). Now those errors are surfaced. Adjusted a handful of
tests accordingly.

Change-Id: Ia555139a05049887aeeec9e5221b1f41432c1a57
Reviewed-on: https://go-review.googlesource.com/c/go/+/478635
Reviewed-by: Robert Griesemer &lt;gri@google.com&gt;
Auto-Submit: Robert Griesemer &lt;gri@google.com&gt;
Reviewed-by: Robert Findley &lt;rfindley@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Run-TryBot: Robert Griesemer &lt;gri@google.com&gt;
</content>
</entry>
<entry>
<title>cmd/compile/internal/types2: avoid "declared but not used" errors for invalid code</title>
<updated>2021-09-23T19:41:45Z</updated>
<author>
<name>Robert Griesemer</name>
<email>gri@golang.org</email>
</author>
<published>2021-09-23T04:57:19Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=ddb5a42b25c63df9f11669bd4b14eeebcd2ba2bb'/>
<id>urn:sha1:ddb5a42b25c63df9f11669bd4b14eeebcd2ba2bb</id>
<content type='text'>
Agressively mark all LHS variables in assignments as used if there
is any error in the (entire) assignment. This reduces the number of
spurious "declared but not used" errors in programs that are invalid
in the first place. This behavior is closer to the behavior of the
compiler's original type checker (types1) and lets us remove lines
of the form "_ = variable" just to satisfy test cases. It also makes
more important errors visible by not crowding them out.

Remove the Checker.useLHS function and use Checker.use instead:
useLHS didn't evaluate top-level variables, but we actually want
them to be evaluated in an error scenario so that they are getting
used (and thus we don't get the "declared but not used" error).

Fixes #42937.

Change-Id: Idda460f6b81c66735bf9fd597c54188949bf12b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/351730
Trust: Robert Griesemer &lt;gri@golang.org&gt;
Run-TryBot: Robert Griesemer &lt;gri@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Robert Findley &lt;rfindley@google.com&gt;
</content>
</entry>
<entry>
<title>[dev.typeparams] test: adjust more test cases to match compiler -G output</title>
<updated>2020-12-03T17:55:56Z</updated>
<author>
<name>Robert Griesemer</name>
<email>gri@golang.org</email>
</author>
<published>2020-12-02T01:37:12Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=7a1aa7dfaf9a7208a6cae7518037d885c9fabdbd'/>
<id>urn:sha1:7a1aa7dfaf9a7208a6cae7518037d885c9fabdbd</id>
<content type='text'>
With this CL, the first ~500 errorcheck tests pass when running

go run run.go -v -G

in the $GOROOT/test directory (the log output includes a few dozen
tests that are currently skipped).

Change-Id: I9eaa2319fb39a090df54f8699ddc29ffe58b1bf1
Reviewed-on: https://go-review.googlesource.com/c/go/+/274975
Trust: Robert Griesemer &lt;gri@golang.org&gt;
Run-TryBot: Robert Griesemer &lt;gri@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Robert Findley &lt;rfindley@google.com&gt;
</content>
</entry>
<entry>
<title>test/interface: document tests</title>
<updated>2012-02-19T06:33:41Z</updated>
<author>
<name>Rob Pike</name>
<email>r@golang.org</email>
</author>
<published>2012-02-19T06:33:41Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=13514d4e0b56a2643525582e1f29ca2f62ad4c28'/>
<id>urn:sha1:13514d4e0b56a2643525582e1f29ca2f62ad4c28</id>
<content type='text'>
Most already had comments (yay); adjusted for consistency.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5676102
</content>
</entry>
<entry>
<title>test: use testlib (fourth 100)</title>
<updated>2012-02-17T04:50:37Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2012-02-17T04:50:37Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=d2cc9884296e84f18ff23550a4561e7b0109efd5'/>
<id>urn:sha1:d2cc9884296e84f18ff23550a4561e7b0109efd5</id>
<content type='text'>
X ,s;^// \$G (\$D/)?\$F\.go *$;// compile;g
X ,s;^// \$G (\$D/)?\$F\.go &amp;&amp; \$L \$F\.\$A *$;// build;g
X ,s;^// \$G (\$D/)?\$F\.go &amp;&amp; \$L \$F\.\$A &amp;&amp; \./\$A\.out *$;// run;g
X ,s;^// errchk \$G( -e)? (\$D/)?\$F\.go *$;// errorcheck;g

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5673079
</content>
</entry>
<entry>
<title>test: match gccgo error messages</title>
<updated>2011-09-22T00:25:48Z</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2011-09-22T00:25:48Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=9169c27eaa5d3209b687249b5045c27f73327715'/>
<id>urn:sha1:9169c27eaa5d3209b687249b5045c27f73327715</id>
<content type='text'>
bug363.go:13:12: error: invalid context-determined non-integer type for shift operand
bug363.go:16:12: error: invalid context-determined non-integer type for shift operand

pointer.go:34:6: error: incompatible type in initialization (pointer to interface type has no methods)
pointer.go:36:6: error: incompatible type in initialization

method2.go:15:1: error: invalid pointer or interface receiver type
method2.go:16:1: error: invalid pointer or interface receiver type
method2.go:21:1: error: invalid pointer or interface receiver type
method2.go:22:1: error: invalid pointer or interface receiver type
method2.go:28:15: error: type ‘*Val’ has no method ‘val’
method2.go:33:11: error: reference to undefined field or method ‘val’

shift1.go:19:16: error: invalid context-determined non-integer type for shift operand
shift1.go:24:19: error: invalid context-determined non-integer type for shift operand
shift1.go:25:17: error: invalid context-determined non-integer type for shift operand
shift1.go:18:18: error: shift of non-integer operand
shift1.go:26:13: error: floating point constant truncated to integer
shift1.go:33:15: error: integer constant overflow
shift1.go:34:15: error: integer constant overflow
shift1.go:35:17: error: integer constant overflow

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5081051
</content>
</entry>
<entry>
<title>errchk: allow multiple patterns</title>
<updated>2011-08-16T15:14:26Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2011-08-16T15:14:26Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=a5d7c1f45e0b36a34462fd8ce10b869e7a12f246'/>
<id>urn:sha1:a5d7c1f45e0b36a34462fd8ce10b869e7a12f246</id>
<content type='text'>
// ERROR "pattern1" "pattern2"

means that there has to be one or more
lines matching pattern1 and then excluding
those, there have to be one or more lines
matching pattern2.  So if you expect two
different error messages from a particular
line, writing two separate patterns checks
that both errors are produced.

Also, errchk now flags lines that produce
more errors than expected.  Before, as long as
at least one error matched the pattern, all the
others were ignored.

Revise tests to expect or silence these
additional errors.

R=lvd, r, iant
CC=golang-dev
https://golang.org/cl/4869044
</content>
</entry>
<entry>
<title>gc: another pointer to interface message</title>
<updated>2011-04-21T12:20:29Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2011-04-21T12:20:29Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=f10a7882c6d2876592bb73a27e7e595caad5c376'/>
<id>urn:sha1:f10a7882c6d2876592bb73a27e7e595caad5c376</id>
<content type='text'>
R=ken2
CC=golang-dev
https://golang.org/cl/4444056
</content>
</entry>
<entry>
<title>gc: new typechecking rules</title>
<updated>2010-06-09T01:50:02Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2010-06-09T01:50:02Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=565b5dc0760baf556f83adf847f578718a1c571f'/>
<id>urn:sha1:565b5dc0760baf556f83adf847f578718a1c571f</id>
<content type='text'>
* Code for assignment, conversions now mirrors spec.
* Changed some snprint -&gt; smprint.
* Renamed runtime functions to separate
  interface conversions from type assertions:
  convT2I, assertI2T, etc.
* Correct checking of \U sequences.

Fixes #840.
Fixes #830.
Fixes #778.

R=ken2
CC=golang-dev
https://golang.org/cl/1303042
</content>
</entry>
<entry>
<title>fix "declared and not used" in tests;</title>
<updated>2009-09-15T04:03:53Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2009-09-15T04:03:53Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=1a3198907bf18ac961762024cf2a27581e6be6c3'/>
<id>urn:sha1:1a3198907bf18ac961762024cf2a27581e6be6c3</id>
<content type='text'>
also template/template.go, missed last time.

R=r
DELTA=116  (61 added, 10 deleted, 45 changed)
OCL=34620
CL=34622
</content>
</entry>
</feed>
