github.com/mdempsky/go@v0.0.0-20151201204031-5dd372bd1e70/test/rename1.go (about)

     1  // errorcheck
     2  
     3  // Copyright 2009 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  // Verify that renamed identifiers no longer have their old meaning.
     8  // Does not compile.
     9  
    10  package main
    11  
    12  func main() {
    13  	var n byte       // ERROR "not a type|expected type"
    14  	var y = float32(0) // ERROR "cannot call|expected function"
    15  	const (
    16  		a = 1 + iota // ERROR "string|incompatible types" "convert iota"
    17  	)
    18  
    19  }
    20  
    21  const (
    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"
    60  )