| 
									
										
										
										
											2012-12-22 19:13:45 +01:00
										 |  |  | // errorcheck | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-04-10 14:32:26 -07:00
										 |  |  | // Copyright 2012 The Go Authors. All rights reserved. | 
					
						
							| 
									
										
										
										
											2012-12-22 19:13:45 +01:00
										 |  |  | // Use of this source code is governed by a BSD-style | 
					
						
							|  |  |  | // license that can be found in the LICENSE file. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Issue 4458: gc accepts invalid method expressions | 
					
						
							|  |  |  | // like (**T).Method. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | package main | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type T struct{} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func (T) foo() {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func main() { | 
					
						
							|  |  |  | 	av := T{} | 
					
						
							|  |  |  | 	pav := &av | 
					
						
							| 
									
										
										
										
											2020-12-09 12:28:15 -08:00
										 |  |  | 	(**T).foo(&pav) // ERROR "no method foo|requires named type or pointer to named|undefined" | 
					
						
							| 
									
										
										
										
											2012-12-22 19:13:45 +01:00
										 |  |  | } |