| 
									
										
										
										
											2012-02-16 23:51:04 -05:00
										 |  |  | // errorcheck | 
					
						
							| 
									
										
										
										
											2009-09-09 01:01:39 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | // Copyright 2009 The Go Authors.  All rights reserved. | 
					
						
							|  |  |  | // Use of this source code is governed by a BSD-style | 
					
						
							|  |  |  | // license that can be found in the LICENSE file. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-24 10:30:39 +11:00
										 |  |  | // Verify that renamed identifiers no longer have their old meaning. | 
					
						
							|  |  |  | // Does not compile. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-09 01:01:39 -07:00
										 |  |  | package main | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func main() { | 
					
						
							| 
									
										
										
										
											2010-03-24 16:46:53 -07:00
										 |  |  | 	var n byte       // ERROR "not a type|expected type" | 
					
						
							| 
									
										
										
										
											2012-02-24 10:30:39 +11:00
										 |  |  | 	var y = float32(0) // ERROR "cannot call|expected function" | 
					
						
							| 
									
										
										
										
											2009-09-09 01:01:39 -07:00
										 |  |  | 	const ( | 
					
						
							| 
									
										
										
										
											2011-08-16 11:14:26 -04:00
										 |  |  | 		a = 1 + iota // ERROR "string|incompatible types" "convert iota" | 
					
						
							| 
									
										
										
										
											2009-09-09 01:01:39 -07:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const ( | 
					
						
							| 
									
										
										
										
											2012-02-24 10:30:39 +11:00
										 |  |  | 	append = iota | 
					
						
							|  |  |  | 	bool | 
					
						
							|  |  |  | 	byte | 
					
						
							|  |  |  | 	complex | 
					
						
							|  |  |  | 	complex64 | 
					
						
							|  |  |  | 	complex128 | 
					
						
							|  |  |  | 	cap | 
					
						
							|  |  |  | 	close | 
					
						
							|  |  |  | 	delete | 
					
						
							|  |  |  | 	error | 
					
						
							|  |  |  | 	false | 
					
						
							|  |  |  | 	float32 | 
					
						
							|  |  |  | 	float64 | 
					
						
							|  |  |  | 	imag | 
					
						
							|  |  |  | 	int | 
					
						
							|  |  |  | 	int8 | 
					
						
							|  |  |  | 	int16 | 
					
						
							|  |  |  | 	int32 | 
					
						
							|  |  |  | 	int64 | 
					
						
							|  |  |  | 	len | 
					
						
							|  |  |  | 	make | 
					
						
							|  |  |  | 	new | 
					
						
							|  |  |  | 	nil | 
					
						
							|  |  |  | 	panic | 
					
						
							|  |  |  | 	print | 
					
						
							|  |  |  | 	println | 
					
						
							|  |  |  | 	real | 
					
						
							|  |  |  | 	recover | 
					
						
							|  |  |  | 	rune | 
					
						
							|  |  |  | 	string | 
					
						
							|  |  |  | 	true | 
					
						
							|  |  |  | 	uint | 
					
						
							|  |  |  | 	uint8 | 
					
						
							|  |  |  | 	uint16 | 
					
						
							|  |  |  | 	uint32 | 
					
						
							|  |  |  | 	uint64 | 
					
						
							|  |  |  | 	uintptr | 
					
						
							|  |  |  | 	NUM | 
					
						
							|  |  |  | 	iota = "123" | 
					
						
							| 
									
										
										
										
											2009-09-09 01:01:39 -07:00
										 |  |  | ) |