summaryrefslogtreecommitdiff
path: root/test/interface
Commit message (Collapse)AuthorAgeFilesLines
* cmd/gc: blank methods are not permitted in interface typesChris Manghane2014-10-152-16/+2
| | | | | | | | | Fixes issue 6606. LGTM=rsc R=rsc CC=golang-codereviews, gri https://codereview.appspot.com/156210044
* cmd/gc: don't attempt to generate wrappers for blank interface methodsAnthony Martin2013-08-192-2/+36
| | | | | | | | | | Fixes issue 5691. R=golang-dev, bradfitz, daniel.morsing, rsc CC=golang-dev https://codereview.appspot.com/10255047 Committer: Rob Pike <r@golang.org>
* test: convert tests to run.go whenever possible.R?my Oudompheng2012-10-109-90/+97
| | | | | | | | | | | The other tests either need a complex procedure or are architecture- or OS-dependent. Update issue 4139. R=golang-dev, daniel.morsing, iant CC=golang-dev http://codereview.appspot.com/6618062
* test: expand run.go's errorcheck, make clear which bugs runRuss Cox2012-09-233-0/+9
| | | | | | | | | | | | | | | | Today, if run.go doesn't understand a test header line it just ignores the test, making it too easy to write or edit tests that are not actually being run. - expand errorcheck to accept flags, so that bounds.go and escape*.go can run. - create a whitelist of skippable tests in run.go; skipping others is an error. - mark all skipped tests at top of file. Update issue 4139. R=golang-dev, bradfitz CC=golang-dev http://codereview.appspot.com/6549054
* cmd/gc: Suggest *T in error for x.(T) if it would work.Daniel Morsing2012-09-011-0/+6
| | | | | | | | | | | | Accomplished by synchronizing the formatting of conversion errors between typecheck.c and subr.c Fixes issue 3984. R=golang-dev, remyoudompheng, rsc CC=golang-dev http://codereview.appspot.com/6500064 Committer: Russ Cox <rsc@golang.org>
* cmd/gc: Don't claim type assertion would help when it wont.Daniel Morsing2012-08-151-1/+1
| | | | | | | | | | Fixes issue 3465. R=golang-dev, rsc, remyoudompheng, iant CC=golang-dev http://codereview.appspot.com/6448097 Committer: Ian Lance Taylor <iant@golang.org>
* test: use testlib in a few more casesShenghou Ma2012-03-223-3/+3
| | | | | | | | Introduce a new skip cmd. R=golang-dev, bradfitz, iant, iant CC=golang-dev http://codereview.appspot.com/5868048
* test/interface: document testsRob Pike2012-02-1921-23/+30
| | | | | | | | Most already had comments (yay); adjusted for consistency. R=golang-dev, bradfitz CC=golang-dev http://codereview.appspot.com/5676102
* test: use testlib (another bunch).R?my Oudompheng2012-02-183-3/+3
| | | | | | | | | | | Apply sed with: 1s,^// $G $D/$F.go && $L $F.$A && ./$A.out || echo.*,// run, 1s,^// $G $D/$F.go || echo.*,// compile, R=golang-dev, rsc CC=golang-dev http://codereview.appspot.com/5656099
* test: use testlib (fourth 100)Russ Cox2012-02-1613-13/+13
| | | | | | | | | | | 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 http://codereview.appspot.com/5673079
* test: don't use package main for files without a main functionBrad Fitzpatrick2012-02-031-1/+1
| | | | | | | | Part of issue 2833, but works fine with current test runner. R=golang-dev, rsc CC=golang-dev http://codereview.appspot.com/5606056
* gc: test case for recursive interface bug.David Symonds2012-01-212-0/+37
| | | | | | R=rsc CC=golang-dev http://codereview.appspot.com/5555066
* gc: implement == on structs and arraysRuss Cox2011-12-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | To allow these types as map keys, we must fill in equal and hash functions in their algorithm tables. Structs or arrays that are "just memory", like [2]int, can and do continue to use the AMEM algorithm. Structs or arrays that contain special values like strings or interface values use generated functions for both equal and hash. The runtime helper func runtime.equal(t, x, y) bool handles the general equality case for x == y and calls out to the equal implementation in the algorithm table. For short values (<= 4 struct fields or array elements), the sequence of elementwise comparisons is inlined instead of calling runtime.equal. R=ken, mpimenov CC=golang-dev http://codereview.appspot.com/5451105
* gc: disallow map/func equality via interface comparisonRuss Cox2011-12-061-0/+39
| | | | | | | | Missed when I removed direct map/func equality. R=ken2 CC=golang-dev http://codereview.appspot.com/5452052
* reflect: disallow Interface method on Value obtained via unexported nameRuss Cox2011-10-171-20/+20
| | | | | | | | | Had been allowing it for use by fmt, but it is too hard to lock down. Fix other packages not to depend on it. R=r, r CC=golang-dev http://codereview.appspot.com/5266054
* test: silence/coalesce some testsRuss Cox2011-09-262-3/+28
| | | | | | | | Add copyright notice to nilptr.go. R=golang-dev, r CC=golang-dev http://codereview.appspot.com/5139048
* test: match gccgo error messagesIan Lance Taylor2011-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 http://codereview.appspot.com/5081051
* errchk: allow multiple patternsRuss Cox2011-08-162-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | // 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 http://codereview.appspot.com/4869044
* fix tree for reflect renameRuss Cox2011-04-251-1/+1
| | | | | | R=golang-dev, r CC=golang-dev http://codereview.appspot.com/4435067
* gc: another pointer to interface messageRuss Cox2011-04-211-0/+1
| | | | | | R=ken2 CC=golang-dev http://codereview.appspot.com/4444056
* update go tree for reflect changesRuss Cox2011-04-081-12/+12
| | | | | | R=golang-dev, r CC=golang-dev http://codereview.appspot.com/4353043
* test: add test for interfaces with unexported methods.Ian Lance Taylor2011-03-292-0/+50
| | | | | | R=rsc CC=golang-dev http://codereview.appspot.com/4271086
* delete float, complex - code changesRuss Cox2011-01-191-8/+12
| | | | | | | | | | | also: cmplx -> complex float64(1.0) -> 1.0 float64(1) -> 1.0 R=gri, r, gri1, r2 CC=golang-dev http://codereview.appspot.com/3991043
* gc, spec, tests: no auto-indirect of pointer to interface valueRuss Cox2010-09-302-22/+71
| | | | | | | | Implies no embedding of pointer to interface value either. R=gri, iant, ken2, r, r2 CC=golang-dev http://codereview.appspot.com/2289041
* test: Match gccgo error messages.Ian Lance Taylor2010-09-081-6/+6
| | | | | | | | | | | | | | | | | | | | explicit.go:36:4: error: incompatible types in assignment (need explicit conversion) explicit.go:41:4: error: incompatible types in assignment (type has no methods) explicit.go:42:4: error: incompatible types in assignment (need explicit conversion) explicit.go:45:5: error: incompatible types in assignment (need explicit conversion; missing method ?N?) explicit.go:48:9: error: invalid type conversion (need explicit conversion; missing method ?N?) explicit.go:51:4: error: incompatible types in assignment explicit.go:51:7: error: invalid type conversion (need explicit conversion) explicit.go:57:10: error: impossible type assertion: type does not implement interface (type has no methods) explicit.go:62:10: error: impossible type assertion: type does not implement interface (incompatible type for method ?M? (different number of parameters)) explicit.go:67:5: error: incompatible type in initialization (type has no methods) explicit.go:68:5: error: incompatible type in initialization (incompatible type for method ?M? (different number of parameters)) explicit.go:70:11: error: invalid type conversion (type has no methods) explicit.go:71:11: error: invalid type conversion (incompatible type for method ?M? (different number of parameters)) R=rsc CC=golang-dev http://codereview.appspot.com/2139044
* test: remove semiocolons.Rob Pike2010-09-0411-242/+242
| | | | | | | | The ken directory is untouched so we have some examples with explicit semis. R=gri CC=golang-dev http://codereview.appspot.com/2157041
* gc: more cleanupRuss Cox2010-06-091-1/+20
| | | | | | | | | | | | * disallow surrogate pair runes. * diagnose impossible type assertions * eliminate another static buffer. * do not overflow lexbuf. * add -u flag to disable package unsafe. R=ken2 CC=golang-dev http://codereview.appspot.com/1619042
* gc: new typechecking rulesRuss Cox2010-06-083-54/+74
| | | | | | | | | | | | | | | | | * Code for assignment, conversions now mirrors spec. * Changed some snprint -> smprint. * Renamed runtime functions to separate interface conversions from type assertions: convT2I, assertI2T, etc. * Correct checking of \U sequences. Fixes issue 840. Fixes issue 830. Fixes issue 778. R=ken2 CC=golang-dev http://codereview.appspot.com/1303042
* single argument panicRuss Cox2010-03-302-55/+64
| | | | | | | | | | | | note that sortmain.go has been run through hg gofmt; only the formatting of the day initializers changed. i'm happy to revert that formatting if you'd prefer. stop on error in doc/progs/run R=r CC=golang-dev http://codereview.appspot.com/850041
* delete all uses of panicln by rewriting them using panic or,Rob Pike2010-03-241-52/+60
| | | | | | | | | in the tests, println+panic. gofmt some tests too. R=rsc CC=golang-dev http://codereview.appspot.com/741041
* test/interface/receiver.go: expand to do dynamicRuss Cox2009-11-141-0/+8
| | | | | | | versions of static checks in receiver1.go R=r http://codereview.appspot.com/155045
* make 5l ignore multiple defs, remove use of multipleKai Backman2009-10-251-1/+1
| | | | | | | defs from embed1 and gotest R=rsc http://go/go-review/1014009
* forgot to include in 35898.Russ Cox2009-10-201-0/+29
| | | | | | R=ken OCL=35917 CL=35917
* 6g bug fixes:Russ Cox2009-10-192-21/+66
| | | | | | | | | | * bug211 * embedded interfaces with lowercase methods * var _ = f() at top level R=ken OCL=35898 CL=35898
* fiddling while rome burns: explain why tests are commented outRob Pike2009-10-191-0/+2
| | | | | | | R=rsc DELTA=2 (2 added, 0 deleted, 0 changed) OCL=35874 CL=35880
* fix "declared and not used" in tests;Russ Cox2009-09-144-3/+8
| | | | | | | | | also template/template.go, missed last time. R=r DELTA=116 (61 added, 10 deleted, 45 changed) OCL=34620 CL=34622
* fix up some irregular indentationRob Pike2009-08-171-79/+79
| | | | | | R=rsc OCL=33382 CL=33391
* delete forward type declarationsRuss Cox2009-08-122-4/+0
| | | | | | | R=r DELTA=163 (1 added, 149 deleted, 13 changed) OCL=33106 CL=33111
* convert non-pkg go files to whole-package compilation.Russ Cox2009-08-121-1/+0
| | | | | | | | | mostly removing forward declarations. R=r DELTA=138 (2 added, 127 deleted, 9 changed) OCL=33068 CL=33099
* more 6g reorg; checkpoint.Russ Cox2009-08-031-1/+1
| | | | | | | | | typecheck.c is now responsible for all type checking except for assignment and function argument "..." R=ken OCL=32661 CL=32667
* Recognize gccgo error message.Ian Lance Taylor2009-07-171-1/+1
| | | | | | | | | | | | | | explicit.go:21:5: error: incompatible types in assignment (need explicit conversion) explicit.go:26:5: error: incompatible types in assignment (type has no methods) explicit.go:27:5: error: incompatible types in assignment (need explicit conversion) explicit.go:30:6: error: incompatible types in assignment (need explicit conversion; missing method ?N?) explicit.go:33:7: error: invalid type conversion (need explicit conversion; missing method ?N?) explicit.go:36:5: error: incompatible types in assignment R=rsc DELTA=1 (0 added, 0 deleted, 1 changed) OCL=31805 CL=31807
* update tests for new reflectRuss Cox2009-07-071-10/+10
| | | | | | | R=r DELTA=12 (0 added, 0 deleted, 12 changed) OCL=31240 CL=31290
* allow conversion to interface typeRuss Cox2009-07-061-4/+11
| | | | | | | | when implicit assignment would have been okay. R=ken OCL=31225 CL=31227
* another interface conversion testRuss Cox2009-05-221-0/+25
| | | | | | | R=r DELTA=21 (21 added, 0 deleted, 0 changed) OCL=29212 CL=29249
* add test for yesterday's interface rule change (interface/convert1.go).Russ Cox2009-05-2113-0/+867
move interface tests to subdirectory. R=r DELTA=1632 (827 added, 804 deleted, 1 changed) OCL=29181 CL=29191