Russ Cox | 57eb06f | 2012-02-16 23:51:04 -0500 | [diff] [blame] | 1 | // errorcheck |
Russ Cox | e780fa8 | 2009-09-09 01:01:39 -0700 | [diff] [blame] | 2 | |
Emmanuel Odeke | 53fd522 | 2016-04-10 14:32:26 -0700 | [diff] [blame] | 3 | // Copyright 2009 The Go Authors. All rights reserved. |
Russ Cox | e780fa8 | 2009-09-09 01:01:39 -0700 | [diff] [blame] | 4 | // Use of this source code is governed by a BSD-style |
| 5 | // license that can be found in the LICENSE file. |
| 6 | |
Rob Pike | 19bab1d | 2012-02-24 10:30:39 +1100 | [diff] [blame] | 7 | // Verify that renamed identifiers no longer have their old meaning. |
| 8 | // Does not compile. |
| 9 | |
Russ Cox | e780fa8 | 2009-09-09 01:01:39 -0700 | [diff] [blame] | 10 | package main |
| 11 | |
| 12 | func main() { |
Kashav Madan | d05a123 | 2017-06-27 19:29:59 -0400 | [diff] [blame] | 13 | var n byte // ERROR "not a type|expected type" |
Rob Pike | 19bab1d | 2012-02-24 10:30:39 +1100 | [diff] [blame] | 14 | var y = float32(0) // ERROR "cannot call|expected function" |
Russ Cox | e780fa8 | 2009-09-09 01:01:39 -0700 | [diff] [blame] | 15 | const ( |
Robert Griesemer | 02820d6 | 2020-12-03 18:15:50 -0800 | [diff] [blame] | 16 | a = 1 + iota // ERROR "invalid operation|incompatible types|cannot convert" |
Russ Cox | e780fa8 | 2009-09-09 01:01:39 -0700 | [diff] [blame] | 17 | ) |
| 18 | |
| 19 | } |
| 20 | |
| 21 | const ( |
Rob Pike | d45ee4c | 2012-02-24 15:06:32 +1100 | [diff] [blame] | 22 | append = 1 |
| 23 | bool = 2 |
| 24 | byte = 3 |
| 25 | complex = 4 |
| 26 | complex64 = 5 |
| 27 | complex128 = 6 |
| 28 | cap = 7 |
| 29 | close = 8 |
| 30 | delete = 9 |
| 31 | error = 10 |
| 32 | false = 11 |
| 33 | float32 = 12 |
| 34 | float64 = 13 |
| 35 | imag = 14 |
| 36 | int = 15 |
| 37 | int8 = 16 |
| 38 | int16 = 17 |
| 39 | int32 = 18 |
| 40 | int64 = 19 |
| 41 | len = 20 |
| 42 | make = 21 |
| 43 | new = 22 |
| 44 | nil = 23 |
| 45 | panic = 24 |
| 46 | print = 25 |
| 47 | println = 26 |
| 48 | real = 27 |
| 49 | recover = 28 |
| 50 | rune = 29 |
| 51 | string = 30 |
| 52 | true = 31 |
| 53 | uint = 32 |
| 54 | uint8 = 33 |
| 55 | uint16 = 34 |
| 56 | uint32 = 35 |
| 57 | uint64 = 36 |
| 58 | uintptr = 37 |
| 59 | iota = "38" |
Russ Cox | e780fa8 | 2009-09-09 01:01:39 -0700 | [diff] [blame] | 60 | ) |