|
| 1 | +declarationEmitBindingPatternsUnused.ts(81,35): error TS2842: 'alias' is an unused renaming of 'name'. Did you intend to use it as a type annotation? |
| 2 | +declarationEmitBindingPatternsUnused.ts(85,41): error TS2842: 'alias' is an unused renaming of 'name'. Did you intend to use it as a type annotation? |
| 3 | +declarationEmitBindingPatternsUnused.ts(91,11): error TS2842: 'alias' is an unused renaming of 'name'. Did you intend to use it as a type annotation? |
| 4 | +declarationEmitBindingPatternsUnused.ts(92,15): error TS2842: 'alias' is an unused renaming of 'name'. Did you intend to use it as a type annotation? |
| 5 | +declarationEmitBindingPatternsUnused.ts(93,16): error TS2842: 'alias' is an unused renaming of 'name'. Did you intend to use it as a type annotation? |
| 6 | +declarationEmitBindingPatternsUnused.ts(94,12): error TS2842: 'alias' is an unused renaming of 'name'. Did you intend to use it as a type annotation? |
| 7 | + |
| 8 | + |
| 9 | +==== declarationEmitBindingPatternsUnused.ts (6 errors) ==== |
| 10 | + type Named = { name: string } |
| 11 | + function notReferenced({ name: alias }: Named) { |
| 12 | + |
| 13 | + } |
| 14 | + function notReferencedNestedAlias({ p: { name: alias } }: { p: Named }) { |
| 15 | + } |
| 16 | + function notReferencedArrayAlias([a, b, { name: alias }]: Named[]) { |
| 17 | + } |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + function referencedInCode({ name: alias }: Named) { |
| 22 | + return alias; |
| 23 | + } |
| 24 | + |
| 25 | + function referencedInSignarture({ name: alias }: Named): typeof alias { |
| 26 | + return alias; |
| 27 | + } |
| 28 | + |
| 29 | + function referencedInInferredType({ name: alias }: Named) { |
| 30 | + type Named2 = { name: typeof alias } |
| 31 | + return null! as Named2 |
| 32 | + } |
| 33 | + |
| 34 | + function referencedInNestedFunction({ name: alias }: Named) { |
| 35 | + return function(p: typeof alias) { |
| 36 | + |
| 37 | + } |
| 38 | + } |
| 39 | + |
| 40 | + function referencedNestedAlias({ p: { name: alias } }: { p: Named }): typeof alias { |
| 41 | + return alias; |
| 42 | + } |
| 43 | + |
| 44 | + function referencedArrayAlias([a, b, { name: alias }]: Named[]): typeof alias { |
| 45 | + return alias; |
| 46 | + } |
| 47 | + |
| 48 | + |
| 49 | + class NotReferencedClass { |
| 50 | + constructor({ name: alias }: Named) { |
| 51 | + } |
| 52 | + set x({ name: alias }: Named) { |
| 53 | + console.log(alias); |
| 54 | + } |
| 55 | + m({ name: alias }: Named) { |
| 56 | + console.log(alias); |
| 57 | + } |
| 58 | + } |
| 59 | + |
| 60 | + class ReferencedInCodeClas { |
| 61 | + constructor({ name: alias }: Named) { |
| 62 | + console.log(alias); |
| 63 | + } |
| 64 | + set x({ name: alias }: Named) { |
| 65 | + console.log(alias); |
| 66 | + } |
| 67 | + m({ name: alias }: Named) { |
| 68 | + console.log(alias); |
| 69 | + } |
| 70 | + } |
| 71 | + |
| 72 | + class ReferencedInSignartureClass { |
| 73 | + constructor({ name: alias }: Named, p: typeof alias) { |
| 74 | + console.log(alias); |
| 75 | + } |
| 76 | + set x({ name: alias }: Named & { o: typeof alias }) { |
| 77 | + |
| 78 | + } |
| 79 | + mReturnType({ name: alias }: Named): typeof alias { |
| 80 | + return null! |
| 81 | + } |
| 82 | + mRerturnTypeNested({ name: alias }: Named): NonNullable<typeof alias> { |
| 83 | + return null! |
| 84 | + } |
| 85 | + mParameter({ name: alias }: Named, p: typeof alias) { |
| 86 | + return null! |
| 87 | + } |
| 88 | + } |
| 89 | + |
| 90 | + let notReferencedFnType: ({ name: alias }: Named) => void; |
| 91 | + ~~~~~ |
| 92 | +!!! error TS2842: 'alias' is an unused renaming of 'name'. Did you intend to use it as a type annotation? |
| 93 | + let referencedInSignartureReturnTypeFnType: ({ name: alias }: Named) => typeof alias; |
| 94 | + let referencedInSignartureParamTypeFnType: ({ name: alias }: Named, p: typeof alias) => void; |
| 95 | + |
| 96 | + let notReferencedCtorType: new ({ name: alias }: Named) => void; |
| 97 | + ~~~~~ |
| 98 | +!!! error TS2842: 'alias' is an unused renaming of 'name'. Did you intend to use it as a type annotation? |
| 99 | + let referencedInSignartureReturnTypeCtorType: new ({ name: alias }: Named) => typeof alias; |
| 100 | + let referencedInSignartureParamTypeCtorType: new ({ name: alias }: Named, p: typeof alias) => void; |
| 101 | + |
| 102 | + |
| 103 | + interface NotReferencedInterface { |
| 104 | + ({ name: alias }: Named): void |
| 105 | + ~~~~~ |
| 106 | +!!! error TS2842: 'alias' is an unused renaming of 'name'. Did you intend to use it as a type annotation? |
| 107 | + new ({ name: alias }: Named): void |
| 108 | + ~~~~~ |
| 109 | +!!! error TS2842: 'alias' is an unused renaming of 'name'. Did you intend to use it as a type annotation? |
| 110 | + set x({ name: alias }: Named); |
| 111 | + ~~~~~ |
| 112 | +!!! error TS2842: 'alias' is an unused renaming of 'name'. Did you intend to use it as a type annotation? |
| 113 | + m({ name: alias }: Named); |
| 114 | + ~~~~~ |
| 115 | +!!! error TS2842: 'alias' is an unused renaming of 'name'. Did you intend to use it as a type annotation? |
| 116 | + } |
| 117 | + |
| 118 | + interface ReferencedInSignartureInterface { |
| 119 | + ({ name: alias }: Named, p: typeof alias): void |
| 120 | + ({ name: alias }: Named): typeof alias |
| 121 | + |
| 122 | + new ({ name: alias }: Named, p: typeof alias): void |
| 123 | + new ({ name: alias }: Named): typeof alias |
| 124 | + set x({ name: alias }: Named & { o: typeof alias }) |
| 125 | + mReturnType({ name: alias }: Named): typeof alias; |
| 126 | + mRerturnTypeNested({ name: alias }: Named): NonNullable<typeof alias>; |
| 127 | + mParameter({ name: alias }: Named, p: typeof alias); |
| 128 | + } |
0 commit comments