mirror of
				https://github.com/mgechev/revive.git
				synced 2025-10-30 23:37:49 +02:00 
			
		
		
		
	fix (1217): getting parameter type names panics in presence of generic types (#1218)
This commit is contained in:
		| @@ -71,6 +71,8 @@ func getFieldTypeName(typ ast.Expr) string { | ||||
| 		return f.Sel.Name + "." + getFieldTypeName(f.X) | ||||
| 	case *ast.StarExpr: | ||||
| 		return "*" + getFieldTypeName(f.X) | ||||
| 	case *ast.IndexExpr: | ||||
| 		return getFieldTypeName(f.X) + "[" + getFieldTypeName(f.Index) + "]" | ||||
| 	default: | ||||
| 		panic(fmt.Sprintf("not supported type %T", typ)) | ||||
| 	} | ||||
|   | ||||
							
								
								
									
										3
									
								
								testdata/golint/sort.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								testdata/golint/sort.go
									
									
									
									
										vendored
									
									
								
							| @@ -41,3 +41,6 @@ func (vv Vv) Less(i int, j int) (result bool) { return w[i] < w[j] } // MATCH /e | ||||
| type X []int | ||||
|  | ||||
| func (x X) Less(i *pkg.tip) (result bool) { return len(x) } // MATCH /exported method X.Less should have comment or be unexported/ | ||||
|  | ||||
| // Test for issue #1217 | ||||
| func (s *synchronized[T]) Swap(other Synchronized[T]) {} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user