|
| 1 | +decoratorUsedBeforeDeclaration.ts(1,2): error TS2448: Block-scoped variable 'lambda' used before its declaration. |
| 2 | +decoratorUsedBeforeDeclaration.ts(1,9): error TS2450: Enum 'Enum' used before its declaration. |
| 3 | +decoratorUsedBeforeDeclaration.ts(2,7): error TS2450: Enum 'Enum' used before its declaration. |
| 4 | +decoratorUsedBeforeDeclaration.ts(4,4): error TS2448: Block-scoped variable 'lambda' used before its declaration. |
| 5 | +decoratorUsedBeforeDeclaration.ts(4,11): error TS2450: Enum 'Enum' used before its declaration. |
| 6 | +decoratorUsedBeforeDeclaration.ts(4,16): error TS2729: Property 'No' is used before its initialization. |
| 7 | +decoratorUsedBeforeDeclaration.ts(5,9): error TS2450: Enum 'Enum' used before its declaration. |
| 8 | +decoratorUsedBeforeDeclaration.ts(5,14): error TS2729: Property 'No' is used before its initialization. |
| 9 | +decoratorUsedBeforeDeclaration.ts(12,4): error TS2448: Block-scoped variable 'lambda' used before its declaration. |
| 10 | +decoratorUsedBeforeDeclaration.ts(12,11): error TS2450: Enum 'Enum' used before its declaration. |
| 11 | +decoratorUsedBeforeDeclaration.ts(13,9): error TS2450: Enum 'Enum' used before its declaration. |
| 12 | +decoratorUsedBeforeDeclaration.ts(18,4): error TS2448: Block-scoped variable 'lambda' used before its declaration. |
| 13 | +decoratorUsedBeforeDeclaration.ts(24,11): error TS2448: Block-scoped variable 'lambda' used before its declaration. |
| 14 | +decoratorUsedBeforeDeclaration.ts(24,18): error TS2450: Enum 'Enum' used before its declaration. |
| 15 | +decoratorUsedBeforeDeclaration.ts(24,33): error TS2450: Enum 'Enum' used before its declaration. |
| 16 | +decoratorUsedBeforeDeclaration.ts(28,11): error TS2448: Block-scoped variable 'lambda' used before its declaration. |
| 17 | + |
| 18 | + |
| 19 | +==== decoratorUsedBeforeDeclaration.ts (16 errors) ==== |
| 20 | + @lambda(Enum.No) |
| 21 | + ~~~~~~ |
| 22 | +!!! error TS2448: Block-scoped variable 'lambda' used before its declaration. |
| 23 | +!!! related TS2728 decoratorUsedBeforeDeclaration.ts:40:7: 'lambda' is declared here. |
| 24 | + ~~~~ |
| 25 | +!!! error TS2450: Enum 'Enum' used before its declaration. |
| 26 | +!!! related TS2728 decoratorUsedBeforeDeclaration.ts:35:6: 'Enum' is declared here. |
| 27 | + @deco(Enum.No) |
| 28 | + ~~~~ |
| 29 | +!!! error TS2450: Enum 'Enum' used before its declaration. |
| 30 | +!!! related TS2728 decoratorUsedBeforeDeclaration.ts:35:6: 'Enum' is declared here. |
| 31 | + class Greeter { |
| 32 | + @lambda(Enum.No) |
| 33 | + ~~~~~~ |
| 34 | +!!! error TS2448: Block-scoped variable 'lambda' used before its declaration. |
| 35 | +!!! related TS2728 decoratorUsedBeforeDeclaration.ts:40:7: 'lambda' is declared here. |
| 36 | + ~~~~ |
| 37 | +!!! error TS2450: Enum 'Enum' used before its declaration. |
| 38 | +!!! related TS2728 decoratorUsedBeforeDeclaration.ts:35:6: 'Enum' is declared here. |
| 39 | + ~~ |
| 40 | +!!! error TS2729: Property 'No' is used before its initialization. |
| 41 | +!!! related TS2728 decoratorUsedBeforeDeclaration.ts:36:3: 'No' is declared here. |
| 42 | + @deco(Enum.No) |
| 43 | + ~~~~ |
| 44 | +!!! error TS2450: Enum 'Enum' used before its declaration. |
| 45 | +!!! related TS2728 decoratorUsedBeforeDeclaration.ts:35:6: 'Enum' is declared here. |
| 46 | + ~~ |
| 47 | +!!! error TS2729: Property 'No' is used before its initialization. |
| 48 | +!!! related TS2728 decoratorUsedBeforeDeclaration.ts:36:3: 'No' is declared here. |
| 49 | + greeting: string; |
| 50 | + |
| 51 | + constructor(message: string) { |
| 52 | + this.greeting = message; |
| 53 | + } |
| 54 | + |
| 55 | + @lambda(Enum.No) |
| 56 | + ~~~~~~ |
| 57 | +!!! error TS2448: Block-scoped variable 'lambda' used before its declaration. |
| 58 | +!!! related TS2728 decoratorUsedBeforeDeclaration.ts:40:7: 'lambda' is declared here. |
| 59 | + ~~~~ |
| 60 | +!!! error TS2450: Enum 'Enum' used before its declaration. |
| 61 | +!!! related TS2728 decoratorUsedBeforeDeclaration.ts:35:6: 'Enum' is declared here. |
| 62 | + @deco(Enum.No) |
| 63 | + ~~~~ |
| 64 | +!!! error TS2450: Enum 'Enum' used before its declaration. |
| 65 | +!!! related TS2728 decoratorUsedBeforeDeclaration.ts:35:6: 'Enum' is declared here. |
| 66 | + greet() { |
| 67 | + return "Hello, " + this.greeting; |
| 68 | + } |
| 69 | + |
| 70 | + @lambda |
| 71 | + ~~~~~~ |
| 72 | +!!! error TS2448: Block-scoped variable 'lambda' used before its declaration. |
| 73 | +!!! related TS2728 decoratorUsedBeforeDeclaration.ts:40:7: 'lambda' is declared here. |
| 74 | + @deco |
| 75 | + greet1() { |
| 76 | + return "Hello, " + this.greeting; |
| 77 | + } |
| 78 | + |
| 79 | + greet2(@lambda(Enum.No) @deco(Enum.No) param) { |
| 80 | + ~~~~~~ |
| 81 | +!!! error TS2448: Block-scoped variable 'lambda' used before its declaration. |
| 82 | +!!! related TS2728 decoratorUsedBeforeDeclaration.ts:40:7: 'lambda' is declared here. |
| 83 | + ~~~~ |
| 84 | +!!! error TS2450: Enum 'Enum' used before its declaration. |
| 85 | +!!! related TS2728 decoratorUsedBeforeDeclaration.ts:35:6: 'Enum' is declared here. |
| 86 | + ~~~~ |
| 87 | +!!! error TS2450: Enum 'Enum' used before its declaration. |
| 88 | +!!! related TS2728 decoratorUsedBeforeDeclaration.ts:35:6: 'Enum' is declared here. |
| 89 | + return "Hello, " + this.greeting; |
| 90 | + } |
| 91 | + |
| 92 | + greet3(@lambda @deco param) { |
| 93 | + ~~~~~~ |
| 94 | +!!! error TS2448: Block-scoped variable 'lambda' used before its declaration. |
| 95 | +!!! related TS2728 decoratorUsedBeforeDeclaration.ts:40:7: 'lambda' is declared here. |
| 96 | + return "Hello, " + this.greeting; |
| 97 | + } |
| 98 | + } |
| 99 | + |
| 100 | + function deco(...args: any[]): any {} |
| 101 | + |
| 102 | + enum Enum { |
| 103 | + No = 0, |
| 104 | + Yes = 1, |
| 105 | + } |
| 106 | + |
| 107 | + const lambda = (...args: any[]): any => {}; |
| 108 | + |
| 109 | + @lambda(Enum.No) |
| 110 | + @deco(Enum.No) |
| 111 | + class Greeter1 { |
| 112 | + @lambda(Enum.No) |
| 113 | + @deco(Enum.No) |
| 114 | + greeting: string; |
| 115 | + |
| 116 | + constructor(message: string) { |
| 117 | + this.greeting = message; |
| 118 | + } |
| 119 | + |
| 120 | + @lambda(Enum.No) |
| 121 | + @deco(Enum.No) |
| 122 | + greet() { |
| 123 | + return "Hello, " + this.greeting; |
| 124 | + } |
| 125 | + |
| 126 | + @lambda |
| 127 | + @deco |
| 128 | + greet1() { |
| 129 | + return "Hello, " + this.greeting; |
| 130 | + } |
| 131 | + |
| 132 | + greet2(@lambda(Enum.No) @deco(Enum.No) param) { |
| 133 | + return "Hello, " + this.greeting; |
| 134 | + } |
| 135 | + |
| 136 | + greet3(@lambda @deco param) { |
| 137 | + return "Hello, " + this.greeting; |
| 138 | + } |
| 139 | + } |
| 140 | + |
0 commit comments