| 1 |
// errorcheck |
| 2 |
|
| 3 |
// Copyright 2019 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 |
package p |
| 8 |
|
| 9 |
const ( |
| 10 |
f = 1.0 |
| 11 |
c = 1.0i |
| 12 |
|
| 13 |
_ = ^f // ERROR "invalid operation|expected integer" |
| 14 |
_ = ^c // ERROR "invalid operation|expected integer" |
| 15 |
|
| 16 |
_ = f % f // ERROR "invalid operation|expected integer" |
| 17 |
_ = c % c // ERROR "invalid operation|expected integer" |
| 18 |
|
| 19 |
_ = f & f // ERROR "invalid operation|expected integer" |
| 20 |
_ = c & c // ERROR "invalid operation|expected integer" |
| 21 |
|
| 22 |
_ = f | f // ERROR "invalid operation|expected integer" |
| 23 |
_ = c | c // ERROR "invalid operation|expected integer" |
| 24 |
|
| 25 |
_ = f ^ f // ERROR "invalid operation|expected integer" |
| 26 |
_ = c ^ c // ERROR "invalid operation|expected integer" |
| 27 |
|
| 28 |
_ = f &^ f // ERROR "invalid operation|expected integer" |
| 29 |
_ = c &^ c // ERROR "invalid operation|expected integer" |
| 30 |
) |