|
| 1 | +======================================================================== |
| 2 | +Unused type parameter inspection: function |
| 3 | +======================================================================== |
| 4 | +fun main<T>() {} |
| 5 | +------------------------------------------------------------------------ |
| 6 | +3 0:9 to 0:10 Type parameter 'T' is never used (tolk) |
| 7 | + |
| 8 | +======================================================================== |
| 9 | +Used type parameter inspection: function |
| 10 | +======================================================================== |
| 11 | +fun main<T>(param: T) { |
| 12 | + param; |
| 13 | +} |
| 14 | +------------------------------------------------------------------------ |
| 15 | +no issues |
| 16 | + |
| 17 | +======================================================================== |
| 18 | +Unused several type parameters inspection: function |
| 19 | +======================================================================== |
| 20 | +fun main<TName, TOther>() {} |
| 21 | +------------------------------------------------------------------------ |
| 22 | +3 0:9 to 0:14 Type parameter 'TName' is never used (tolk) |
| 23 | +3 0:16 to 0:22 Type parameter 'TOther' is never used (tolk) |
| 24 | + |
| 25 | +======================================================================== |
| 26 | +Used and unused type parameter inspection: function |
| 27 | +======================================================================== |
| 28 | +fun main<TName, TOther>(param: TName) { |
| 29 | + param; |
| 30 | +} |
| 31 | +------------------------------------------------------------------------ |
| 32 | +3 0:16 to 0:22 Type parameter 'TOther' is never used (tolk) |
| 33 | + |
| 34 | +======================================================================== |
| 35 | +Unused type parameter inspection: method |
| 36 | +======================================================================== |
| 37 | +fun int.bar<T>() {} |
| 38 | +------------------------------------------------------------------------ |
| 39 | +3 0:8 to 0:11 Method 'bar' is never used (tolk) |
| 40 | +3 0:12 to 0:13 Type parameter 'T' is never used (tolk) |
| 41 | + |
| 42 | +======================================================================== |
| 43 | +Used type parameter inspection: method |
| 44 | +======================================================================== |
| 45 | +fun int.bar<T>(): T {} |
| 46 | +------------------------------------------------------------------------ |
| 47 | +3 0:8 to 0:11 Method 'bar' is never used (tolk) |
| 48 | + |
| 49 | +======================================================================== |
| 50 | +Unused type parameter inspection: struct |
| 51 | +======================================================================== |
| 52 | +struct Foo<T> {} |
| 53 | +------------------------------------------------------------------------ |
| 54 | +3 0:7 to 0:10 Struct 'Foo' is never used (tolk) |
| 55 | +3 0:11 to 0:12 Type parameter 'T' is never used (tolk) |
| 56 | + |
| 57 | +======================================================================== |
| 58 | +Used type parameter inspection: struct |
| 59 | +======================================================================== |
| 60 | +struct Foo<T> { |
| 61 | + field: T |
| 62 | +} |
| 63 | +------------------------------------------------------------------------ |
| 64 | +3 0:7 to 0:10 Struct 'Foo' is never used (tolk) |
| 65 | +3 1:4 to 1:12 Field 'field' is never used (tolk) |
| 66 | + |
| 67 | +======================================================================== |
| 68 | +Unused type parameter inspection: type alias |
| 69 | +======================================================================== |
| 70 | +type Foo<T> = int | slice |
| 71 | +------------------------------------------------------------------------ |
| 72 | +3 0:5 to 0:8 Type alias 'Foo' is never used (tolk) |
| 73 | +3 0:9 to 0:10 Type parameter 'T' is never used (tolk) |
| 74 | + |
| 75 | +======================================================================== |
| 76 | +Used type parameter inspection: type alias |
| 77 | +======================================================================== |
| 78 | +type Foo<T> = T | null |
| 79 | +------------------------------------------------------------------------ |
| 80 | +3 0:5 to 0:8 Type alias 'Foo' is never used (tolk) |
0 commit comments