diff options
Diffstat (limited to 'test/ddd1.go')
-rw-r--r-- | test/ddd1.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ddd1.go b/test/ddd1.go index 6f714c078..fcd32c282 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 "[.][.][.]" +} |