staticcheck/sa4000/testdata/go1.18/CheckLhsRhsIdentical/generics.go
raw| 1 | package pkg |
| 2 | |
| 3 | func tpfn1[T comparable](x T) { |
| 4 | if x != x { |
| 5 | } |
| 6 | } |
| 7 | |
| 8 | func tpfn2[T int | string](x T) { |
| 9 | if x != x { //@ diag(`identical expressions`) |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | func tpfn3[T int | float64](x T) { |
| 14 | if x != x { |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | func tpfn4[E int | int64, T [4]E](x T) { |
| 19 | if x != x { //@ diag(`identical expressions`) |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | func tpfn5[E int | float64, T [4]E](x T) { |
| 24 | if x != x { |
| 25 | } |
| 26 | } |