blob: fcbb4f86ec1a71fdfe09476311a431b41e361c1b [file] [log] [blame]
Dan Willemsend2797482017-07-26 13:13:13 -07001// errorcheck
2
3// Copyright 2017 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.
6
7// Check that we don't print duplicate errors for string ->
8// array-literal conversion
9
10package main
11
12func main() {
Dan Willemsencc753b72021-08-31 13:25:42 -070013 _ = []byte{"foo"} // ERROR "cannot use|incompatible type|cannot convert"
14 _ = []int{"foo"} // ERROR "cannot use|incompatible type|cannot convert"
15 _ = []rune{"foo"} // ERROR "cannot use|incompatible type|cannot convert"
Dan Willemsend2797482017-07-26 13:13:13 -070016 _ = []string{"foo"} // OK
17}