|
| 1 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(3,12): error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticName'. |
| 2 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(8,12): error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticNameFn'. |
| 3 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(14,12): error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLength'. |
| 4 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(19,12): error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLengthFn'. |
| 5 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(25,12): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototype'. |
| 6 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(30,12): error TS2300: Duplicate identifier 'prototype'. |
| 7 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(30,12): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototypeFn'. |
| 8 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(36,12): error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCaller'. |
| 9 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(41,12): error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCallerFn'. |
| 10 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(47,12): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArguments'. |
| 11 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(52,12): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArgumentsFn'. |
| 12 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(62,12): error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function '(Anonymous class)'. |
| 13 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(67,12): error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function '(Anonymous class)'. |
| 14 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(73,12): error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function '(Anonymous class)'. |
| 15 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(78,12): error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function '(Anonymous class)'. |
| 16 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(84,12): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function '(Anonymous class)'. |
| 17 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(89,12): error TS2300: Duplicate identifier 'prototype'. |
| 18 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(89,12): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function '(Anonymous class)'. |
| 19 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(95,12): error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function '(Anonymous class)'. |
| 20 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(100,12): error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function '(Anonymous class)'. |
| 21 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(106,12): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function '(Anonymous class)'. |
| 22 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(111,12): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function '(Anonymous class)'. |
| 23 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(121,16): error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticName'. |
| 24 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(128,16): error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticNameFn'. |
| 25 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(136,16): error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLength'. |
| 26 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(143,16): error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLengthFn'. |
| 27 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(151,16): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototype'. |
| 28 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(158,16): error TS2300: Duplicate identifier 'prototype'. |
| 29 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(158,16): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototypeFn'. |
| 30 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(166,16): error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCaller'. |
| 31 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(173,16): error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCallerFn'. |
| 32 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(181,16): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArguments'. |
| 33 | +tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(188,16): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArgumentsFn'. |
| 34 | + |
| 35 | + |
| 36 | +==== tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts (33 errors) ==== |
| 37 | + // name |
| 38 | + class StaticName { |
| 39 | + static name: number; // error |
| 40 | + ~~~~ |
| 41 | +!!! error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticName'. |
| 42 | + name: string; // ok |
| 43 | + } |
| 44 | + |
| 45 | + class StaticNameFn { |
| 46 | + static name() {} // error |
| 47 | + ~~~~ |
| 48 | +!!! error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticNameFn'. |
| 49 | + name() {} // ok |
| 50 | + } |
| 51 | + |
| 52 | + // length |
| 53 | + class StaticLength { |
| 54 | + static length: number; // error |
| 55 | + ~~~~~~ |
| 56 | +!!! error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLength'. |
| 57 | + length: string; // ok |
| 58 | + } |
| 59 | + |
| 60 | + class StaticLengthFn { |
| 61 | + static length() {} // error |
| 62 | + ~~~~~~ |
| 63 | +!!! error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLengthFn'. |
| 64 | + length() {} // ok |
| 65 | + } |
| 66 | + |
| 67 | + // prototype |
| 68 | + class StaticPrototype { |
| 69 | + static prototype: number; // error |
| 70 | + ~~~~~~~~~ |
| 71 | +!!! error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototype'. |
| 72 | + prototype: string; // ok |
| 73 | + } |
| 74 | + |
| 75 | + class StaticPrototypeFn { |
| 76 | + static prototype() {} // error |
| 77 | + ~~~~~~~~~ |
| 78 | +!!! error TS2300: Duplicate identifier 'prototype'. |
| 79 | + ~~~~~~~~~ |
| 80 | +!!! error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototypeFn'. |
| 81 | + prototype() {} // ok |
| 82 | + } |
| 83 | + |
| 84 | + // caller |
| 85 | + class StaticCaller { |
| 86 | + static caller: number; // error |
| 87 | + ~~~~~~ |
| 88 | +!!! error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCaller'. |
| 89 | + caller: string; // ok |
| 90 | + } |
| 91 | + |
| 92 | + class StaticCallerFn { |
| 93 | + static caller() {} // error |
| 94 | + ~~~~~~ |
| 95 | +!!! error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCallerFn'. |
| 96 | + caller() {} // ok |
| 97 | + } |
| 98 | + |
| 99 | + // arguments |
| 100 | + class StaticArguments { |
| 101 | + static arguments: number; // error |
| 102 | + ~~~~~~~~~ |
| 103 | +!!! error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArguments'. |
| 104 | + arguments: string; // ok |
| 105 | + } |
| 106 | + |
| 107 | + class StaticArgumentsFn { |
| 108 | + static arguments() {} // error |
| 109 | + ~~~~~~~~~ |
| 110 | +!!! error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArgumentsFn'. |
| 111 | + arguments() {} // ok |
| 112 | + } |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + // === Static properties on anonymous classes === |
| 117 | + |
| 118 | + // name |
| 119 | + var StaticName_Anonymous = class { |
| 120 | + static name: number; // error |
| 121 | + ~~~~ |
| 122 | +!!! error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function '(Anonymous class)'. |
| 123 | + name: string; // ok |
| 124 | + } |
| 125 | + |
| 126 | + var StaticNameFn_Anonymous = class { |
| 127 | + static name() {} // error |
| 128 | + ~~~~ |
| 129 | +!!! error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function '(Anonymous class)'. |
| 130 | + name() {} // ok |
| 131 | + } |
| 132 | + |
| 133 | + // length |
| 134 | + var StaticLength_Anonymous = class { |
| 135 | + static length: number; // error |
| 136 | + ~~~~~~ |
| 137 | +!!! error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function '(Anonymous class)'. |
| 138 | + length: string; // ok |
| 139 | + } |
| 140 | + |
| 141 | + var StaticLengthFn_Anonymous = class { |
| 142 | + static length() {} // error |
| 143 | + ~~~~~~ |
| 144 | +!!! error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function '(Anonymous class)'. |
| 145 | + length() {} // ok |
| 146 | + } |
| 147 | + |
| 148 | + // prototype |
| 149 | + var StaticPrototype_Anonymous = class { |
| 150 | + static prototype: number; // error |
| 151 | + ~~~~~~~~~ |
| 152 | +!!! error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function '(Anonymous class)'. |
| 153 | + prototype: string; // ok |
| 154 | + } |
| 155 | + |
| 156 | + var StaticPrototypeFn_Anonymous = class { |
| 157 | + static prototype() {} // error |
| 158 | + ~~~~~~~~~ |
| 159 | +!!! error TS2300: Duplicate identifier 'prototype'. |
| 160 | + ~~~~~~~~~ |
| 161 | +!!! error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function '(Anonymous class)'. |
| 162 | + prototype() {} // ok |
| 163 | + } |
| 164 | + |
| 165 | + // caller |
| 166 | + var StaticCaller_Anonymous = class { |
| 167 | + static caller: number; // error |
| 168 | + ~~~~~~ |
| 169 | +!!! error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function '(Anonymous class)'. |
| 170 | + caller: string; // ok |
| 171 | + } |
| 172 | + |
| 173 | + var StaticCallerFn_Anonymous = class { |
| 174 | + static caller() {} // error |
| 175 | + ~~~~~~ |
| 176 | +!!! error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function '(Anonymous class)'. |
| 177 | + caller() {} // ok |
| 178 | + } |
| 179 | + |
| 180 | + // arguments |
| 181 | + var StaticArguments_Anonymous = class { |
| 182 | + static arguments: number; // error |
| 183 | + ~~~~~~~~~ |
| 184 | +!!! error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function '(Anonymous class)'. |
| 185 | + arguments: string; // ok |
| 186 | + } |
| 187 | + |
| 188 | + var StaticArgumentsFn_Anonymous = class { |
| 189 | + static arguments() {} // error |
| 190 | + ~~~~~~~~~ |
| 191 | +!!! error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function '(Anonymous class)'. |
| 192 | + arguments() {} // ok |
| 193 | + } |
| 194 | + |
| 195 | + |
| 196 | + // === Static properties on default exported classes === |
| 197 | + |
| 198 | + // name |
| 199 | + module TestOnDefaultExportedClass_1 { |
| 200 | + class StaticName { |
| 201 | + static name: number; // error |
| 202 | + ~~~~ |
| 203 | +!!! error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticName'. |
| 204 | + name: string; // ok |
| 205 | + } |
| 206 | + } |
| 207 | + |
| 208 | + module TestOnDefaultExportedClass_2 { |
| 209 | + class StaticNameFn { |
| 210 | + static name() {} // error |
| 211 | + ~~~~ |
| 212 | +!!! error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticNameFn'. |
| 213 | + name() {} // ok |
| 214 | + } |
| 215 | + } |
| 216 | + |
| 217 | + // length |
| 218 | + module TestOnDefaultExportedClass_3 { |
| 219 | + export default class StaticLength { |
| 220 | + static length: number; // error |
| 221 | + ~~~~~~ |
| 222 | +!!! error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLength'. |
| 223 | + length: string; // ok |
| 224 | + } |
| 225 | + } |
| 226 | + |
| 227 | + module TestOnDefaultExportedClass_4 { |
| 228 | + export default class StaticLengthFn { |
| 229 | + static length() {} // error |
| 230 | + ~~~~~~ |
| 231 | +!!! error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLengthFn'. |
| 232 | + length() {} // ok |
| 233 | + } |
| 234 | + } |
| 235 | + |
| 236 | + // prototype |
| 237 | + module TestOnDefaultExportedClass_5 { |
| 238 | + export default class StaticPrototype { |
| 239 | + static prototype: number; // error |
| 240 | + ~~~~~~~~~ |
| 241 | +!!! error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototype'. |
| 242 | + prototype: string; // ok |
| 243 | + } |
| 244 | + } |
| 245 | + |
| 246 | + module TestOnDefaultExportedClass_6 { |
| 247 | + export default class StaticPrototypeFn { |
| 248 | + static prototype() {} // error |
| 249 | + ~~~~~~~~~ |
| 250 | +!!! error TS2300: Duplicate identifier 'prototype'. |
| 251 | + ~~~~~~~~~ |
| 252 | +!!! error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototypeFn'. |
| 253 | + prototype() {} // ok |
| 254 | + } |
| 255 | + } |
| 256 | + |
| 257 | + // caller |
| 258 | + module TestOnDefaultExportedClass_7 { |
| 259 | + export default class StaticCaller { |
| 260 | + static caller: number; // error |
| 261 | + ~~~~~~ |
| 262 | +!!! error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCaller'. |
| 263 | + caller: string; // ok |
| 264 | + } |
| 265 | + } |
| 266 | + |
| 267 | + module TestOnDefaultExportedClass_8 { |
| 268 | + export default class StaticCallerFn { |
| 269 | + static caller() {} // error |
| 270 | + ~~~~~~ |
| 271 | +!!! error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCallerFn'. |
| 272 | + caller() {} // ok |
| 273 | + } |
| 274 | + } |
| 275 | + |
| 276 | + // arguments |
| 277 | + module TestOnDefaultExportedClass_9 { |
| 278 | + export default class StaticArguments { |
| 279 | + static arguments: number; // error |
| 280 | + ~~~~~~~~~ |
| 281 | +!!! error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArguments'. |
| 282 | + arguments: string; // ok |
| 283 | + } |
| 284 | + } |
| 285 | + |
| 286 | + module TestOnDefaultExportedClass_10 { |
| 287 | + export default class StaticArgumentsFn { |
| 288 | + static arguments() {} // error |
| 289 | + ~~~~~~~~~ |
| 290 | +!!! error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArgumentsFn'. |
| 291 | + arguments() {} // ok |
| 292 | + } |
| 293 | + } |
0 commit comments