aboutsummaryrefslogtreecommitdiff
path: root/test/assign.go
AgeCommit message (Collapse)Author
2020-12-14[dev.typeparams] merge: merge branch 'dev.regabi' into 'dev.typeparams'Robert Griesemer
The following files had merge conflicts and were merged manually: src/cmd/compile/fmtmap_test.go src/cmd/compile/internal/gc/noder.go src/go/parser/error_test.go test/assign.go test/chan/perm.go test/fixedbugs/issue22822.go test/fixedbugs/issue4458.go test/init.go test/interface/explicit.go test/map1.go test/method2.go The following files had manual changes to make tests pass: test/run.go test/used.go src/cmd/compile/internal/types2/stdlib_test.go Change-Id: Ia495aaaa80ce321ee4ec2a9105780fbe913dbd4c
2020-12-03test: match gccgo error messagesIan Lance Taylor
assign.go:59:28: error: ‘x’ repeated on left side of := assign.go:65:20: error: ‘a’ repeated on left side of := method2.go:36:11: error: reference to method ‘val’ in type that is pointer to interface, not interface method2.go:37:11: error: reference to method ‘val’ in type that is pointer to interface, not interface Change-Id: I8f385c75a82fae4eacf4618df8f9f65932826494 Reviewed-on: https://go-review.googlesource.com/c/go/+/274447 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2020-12-01[dev.typeparams] test: add scaffolding to run.go to check compiler with -G flagRobert Griesemer
Added a new flag -G to run. Setting -G (as in: go run run.go -G) will run tests marked with "errorcheck" (and no other flags) also with the compiler using the new typechecker. Many tests don't pass yet (due to discrepancies in error messages). The top-level tests in the test directory which don't pass yet have been explicitly excluded, permitting to see the current status. Future CLs will bring error messages in sync and eventually all tests should pass. Change-Id: I7caf5eff413e173f68d092af4bbe458434718d74 Reviewed-on: https://go-review.googlesource.com/c/go/+/274313 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2014-10-06cmd/gc: prohibit short variable declarations containing duplicate symbolsEvan Kroske
Fixes #6764. Fixes #8435. LGTM=rsc R=golang-codereviews, r, gobot, rsc CC=golang-codereviews https://golang.org/cl/116440046
2012-02-19test: [a-c]: add introductory comments to testsRob Pike
Very few of the compiler regression tests include a comment saying waht they do. Many are obvious, some are anything but. I've started with a-c in the top directory. More will follow once we agree on the approach, correctness, and thoroughness here. zerodivide.go sneaked in too. R=rsc, r CC=golang-dev https://golang.org/cl/5656100
2012-02-16test: use testlib (first 100)Russ Cox
X ,s;^// \$G (\$D/)?\$F\.go *$;// compile;g X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A *$;// build;g X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A && \./\$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/5656082
2011-11-15allow copy of struct containing unexported fieldsRuss Cox
An experiment: allow structs to be copied even if they contain unexported fields. This gives packages the ability to return opaque values in their APIs, like reflect does for reflect.Value but without the kludgy hacks reflect resorts to. In general, we trust programmers not to do silly things like *x = *y on a package's struct pointers, just as we trust programmers not to do unicode.Letter = unicode.Digit, but packages that want a harder guarantee can introduce an extra level of indirection, like in the changes to os.File in this CL or by using an interface type. All in one CL so that it can be rolled back more easily if we decide this is a bad idea. Originally discussed in March 2011. https://groups.google.com/group/golang-dev/t/3f5d30938c7c45ef R=golang-dev, adg, dvyukov, r, bradfitz, jan.mercl, gri CC=golang-dev https://golang.org/cl/5372095
2010-09-04test: remove semiocolons.Rob Pike
The ken directory is untouched so we have some examples with explicit semis. R=gri CC=golang-dev https://golang.org/cl/2157041
2009-12-03gc: check for assignment to private fields during initializationRuss Cox
R=ken2 https://golang.org/cl/165055
2009-11-15gc: five bug fixes, one better error.Russ Cox
* check for struct literal assignment to private fields. * record, fix crash involving parallel map assignment. * avoid infinite recursion in exportassignok. * make floating point bounds check precise. * avoid crash on invalid receiver. * add context to error about implicit assignment. Fixes #86. Fixes #88. Fixes #158. Fixes #174. Fixes #201. Fixes #204. R=ken2 https://golang.org/cl/154144
2009-10-09rewrite errchk in perl for speed (compared to bash)Russ Cox
R=iant DELTA=125 (51 added, 53 deleted, 21 changed) OCL=35508 CL=35511
2009-09-15last round: non-package codeRuss Cox
R=r DELTA=127 (38 added, 3 deleted, 86 changed) OCL=34640 CL=34650
2009-05-31Adjust expected errors to work with gccgo.Ian Lance Taylor
The change to assign.go is because the gcc testsuite fails to handle .* in a normal way: it matches against the entire compiler output, not just a single line. assign.go:15:6: error: incompatible types in assignment (implicit assignment of 'sync.Mutex' hidden field 'key') assign.go:19:6: error: incompatible types in assignment (implicit assignment of 'sync.Mutex' hidden field 'key') assign.go:23:6: error: incompatible types in assignment (implicit assignment of 'sync.Mutex' hidden field 'key') assign.go:27:6: error: incompatible types in assignment (implicit assignment of 'sync.Mutex' hidden field 'key') chan/perm.go:14:5: error: incompatible types in assignment chan/perm.go:15:5: error: incompatible types in assignment chan/perm.go:16:6: error: incompatible types in assignment chan/perm.go:17:6: error: incompatible types in assignment chan/perm.go:24:7: error: invalid send on receive-only channel chan/perm.go:25:12: error: invalid send on receive-only channel chan/perm.go:31:4: error: invalid receive on send-only channel chan/perm.go:32:9: error: invalid receive on send-only channel chan/perm.go:38:2: error: invalid send on receive-only channel chan/perm.go:42:2: error: invalid receive on send-only channel initializerr.go:14:17: error: reference to undefined variable 'X' initializerr.go:14:19: error: mixture of field and value initializers initializerr.go:15:26: error: duplicate value for field 'Y' initializerr.go:16:10: error: too many values in struct composite literal initializerr.go:18:19: error: index expression is not integer constant initializerr.go:17:11: error: too many elements in composite literal R=rsc DELTA=12 (0 added, 0 deleted, 12 changed) OCL=29657 CL=29665
2009-05-21stricter rules for assignment.Russ Cox
when assigning a multifield object (structs or arrays of structs) they must not contain any fields that could not be assigned individually. R=ken OCL=29192 CL=29194