blob: 058db4494a06b56a75bc516ad1519f70c8966bd7 [file] [log] [blame]
Russ Cox57eb06f2012-02-16 23:51:04 -05001// errorcheck
Russ Coxe780fa82009-09-09 01:01:39 -07002
Emmanuel Odeke53fd5222016-04-10 14:32:26 -07003// Copyright 2009 The Go Authors. All rights reserved.
Russ Coxe780fa82009-09-09 01:01:39 -07004// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
Rob Pike19bab1d2012-02-24 10:30:39 +11007// Verify that renamed identifiers no longer have their old meaning.
8// Does not compile.
9
Russ Coxe780fa82009-09-09 01:01:39 -070010package main
11
12func main() {
Kashav Madand05a1232017-06-27 19:29:59 -040013 var n byte // ERROR "not a type|expected type"
Rob Pike19bab1d2012-02-24 10:30:39 +110014 var y = float32(0) // ERROR "cannot call|expected function"
Russ Coxe780fa82009-09-09 01:01:39 -070015 const (
Robert Griesemer02820d62020-12-03 18:15:50 -080016 a = 1 + iota // ERROR "invalid operation|incompatible types|cannot convert"
Russ Coxe780fa82009-09-09 01:01:39 -070017 )
18
19}
20
21const (
Rob Piked45ee4c2012-02-24 15:06:32 +110022 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 Coxe780fa82009-09-09 01:01:39 -070060)