summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-09-24 11:55:30 -0400
committerRuss Cox <rsc@golang.org>2010-09-24 11:55:30 -0400
commit75dd8fdb34126f0964f4276bf70858e2a1335efe (patch)
treefb4e137a211c57214179ea44615ef89c4519fa3b /test
parent6cf1a344026ce065dd1696c72d1932470b41dbdc (diff)
downloadgo-git-75dd8fdb34126f0964f4276bf70858e2a1335efe.tar.gz
gc: ... changes
R=ken2, ken3 CC=golang-dev https://golang.org/cl/2208047
Diffstat (limited to 'test')
-rw-r--r--test/ddd1.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ddd1.go b/test/ddd1.go
index 6f714c078a..fcd32c282f 100644
--- a/test/ddd1.go
+++ b/test/ddd1.go
@@ -6,6 +6,8 @@
package main
+import "unsafe"
+
func sum(args ...int) int { return 0 }
var (
@@ -26,3 +28,20 @@ var (
_ = funny(nil, nil)
_ = funny([]T{}) // ok because []T{} is a T; passes []T{[]T{}}
)
+
+func bad(args ...int) {
+ print(1, 2, args...) // ERROR "[.][.][.]"
+ println(args...) // ERROR "[.][.][.]"
+ ch := make(chan int)
+ close(ch...) // ERROR "[.][.][.]"
+ _ = len(args...) // ERROR "[.][.][.]"
+ _ = closed(ch...) // ERROR "[.][.][.]"
+ _ = new(int...) // ERROR "[.][.][.]"
+ n := 10
+ _ = make([]byte, n...) // ERROR "[.][.][.]"
+ // TODO(rsc): enable after gofmt bug is fixed
+ // _ = make([]byte, 10 ...) // error "[.][.][.]"
+ var x int
+ _ = unsafe.Pointer(&x...) // ERROR "[.][.][.]"
+ _ = unsafe.Sizeof(x...) // ERROR "[.][.][.]"
+}