1 // errchk $G -e $D/$F.go
3 // Copyright 2010 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
11 func sum(args ...int) int { return 0 }
17 _ = sum(1.5) // ERROR "integer"
18 _ = sum("hello") // ERROR "convert|incompatible"
19 _ = sum([]int{1}) // ERROR "slice literal.*as type int|incompatible"
24 func funny(args ...T) int { return 0 }
29 _ = funny([]T{}) // ok because []T{} is a T; passes []T{[]T{}}
32 func bad(args ...int) {
33 print(1, 2, args...) // ERROR "[.][.][.]"
34 println(args...) // ERROR "[.][.][.]"
36 close(ch...) // ERROR "[.][.][.]"
37 _ = len(args...) // ERROR "[.][.][.]"
38 _ = new(int...) // ERROR "[.][.][.]"
40 _ = make([]byte, n...) // ERROR "[.][.][.]"
41 // TODO(rsc): enable after gofmt bug is fixed
42 // _ = make([]byte, 10 ...) // error "[.][.][.]"
44 _ = unsafe.Pointer(&x...) // ERROR "[.][.][.]"
45 _ = unsafe.Sizeof(x...) // ERROR "[.][.][.]"