| 1 |
package pkg |
| 2 |
|
| 3 |
import "fmt" |
| 4 |
|
| 5 |
type T6 string |
| 6 |
type T9 string |
| 7 |
|
| 8 |
type MyByte byte |
| 9 |
|
| 10 |
type Alias = byte |
| 11 |
type T13 = []byte |
| 12 |
type T14 = []Alias |
| 13 |
|
| 14 |
type T15 = string |
| 15 |
type T16 = T9 |
| 16 |
type T17 = T6 |
| 17 |
|
| 18 |
func (T6) String() string { return "" } |
| 19 |
|
| 20 |
func (T9) Format(f fmt.State, c rune) {} |
| 21 |
|
| 22 |
func fn() { |
| 23 |
var t12 []Alias |
| 24 |
var t13 T13 |
| 25 |
var t14 T14 |
| 26 |
var t15 T15 |
| 27 |
var t16 T16 |
| 28 |
var t17 T17 |
| 29 |
|
| 30 |
_ = fmt.Sprintf("%s", t12) //@ diag(`underlying type is a slice of bytes`) |
| 31 |
_ = fmt.Sprintf("%s", t13) //@ diag(`underlying type is a slice of bytes`) |
| 32 |
_ = fmt.Sprintf("%s", t14) //@ diag(`underlying type is a slice of bytes`) |
| 33 |
_ = fmt.Sprintf("%s", t15) //@ diag(`is already a string`) |
| 34 |
_ = fmt.Sprintf("%s", t17) //@ diag(`should use String() instead of fmt.Sprintf`) |
| 35 |
|
| 36 |
// don't simplify types that implement fmt.Formatter |
| 37 |
_ = fmt.Sprintf("%s", t16) |
| 38 |
} |