/
constructorWithIncompleteTypeAnnotation.errors.txt
556 lines (497 loc) · 27.3 KB
/
constructorWithIncompleteTypeAnnotation.errors.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2503: Cannot find namespace 'module'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,19): error TS1005: ';' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,35): error TS1005: ')' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(24,28): error TS1005: ':' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(24,29): error TS1005: ',' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,18): error TS1128: Declaration or statement expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,26): error TS2304: Cannot find name 'bfs'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,30): error TS1005: ',' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,34): error TS1005: ';' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(31,18): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,17): error TS2304: Cannot find name 'retValue'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,26): error TS1005: ';' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,28): error TS2304: Cannot find name 'bfs'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,21): error TS2304: Cannot find name 'retValue'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(38,17): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,17): error TS2304: Cannot find name 'retValue'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,28): error TS2304: Cannot find name 'bfs'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,41): error TS1005: ';' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,45): error TS1002: Unterminated string literal.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,21): error TS2304: Cannot find name 'retValue'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(46,13): error TS1005: 'try' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(47,17): error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(53,13): error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(58,5): error TS1128: Declaration or statement expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(69,13): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(72,37): error TS1127: Invalid character.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(81,13): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(89,23): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(90,13): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(105,29): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(106,13): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,24): error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(138,13): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(141,32): error TS1005: '{' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(143,13): error TS1005: 'try' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,24): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,30): error TS1005: '{' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,31): error TS2304: Cannot find name 'Property'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(166,13): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(180,40): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(181,13): error TS2322: Type 'boolean' is not assignable to type 'number'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(183,13): error TS2322: Type 'boolean' is not assignable to type 'number'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(187,13): error TS2322: Type 'boolean' is not assignable to type 'number'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(191,13): error TS2322: Type 'boolean' is not assignable to type 'number'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(205,28): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(213,16): error TS2304: Cannot find name 'bool'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,10): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(223,23): error TS2304: Cannot find name 'bool'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(227,13): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(234,14): error TS1005: '{' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,9): error TS1128: Declaration or statement expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,16): error TS2304: Cannot find name 'method1'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,24): error TS2304: Cannot find name 'val'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,27): error TS1005: ',' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,28): error TS2693: 'number' only refers to a type, but is being used as a value here.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,36): error TS1005: ';' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,9): error TS1128: Declaration or statement expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,16): error TS2304: Cannot find name 'method2'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,26): error TS1005: ';' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(241,5): error TS1128: Declaration or statement expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(246,25): error TS2551: Property 'method1' does not exist on type 'B'. Did you mean 'method2'?
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,9): error TS2390: Constructor implementation is missing.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,21): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,44): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,69): error TS1110: Type expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,9): error TS1128: Declaration or statement expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,16): error TS2304: Cannot find name 'Overloads'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,26): error TS2304: Cannot find name 'value'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,31): error TS1005: ',' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,33): error TS2693: 'string' only refers to a type, but is being used as a value here.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,9): error TS1128: Declaration or statement expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,16): error TS2304: Cannot find name 'Overloads'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,27): error TS1135: Argument expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,33): error TS1005: '(' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,35): error TS2693: 'string' only refers to a type, but is being used as a value here.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,43): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,52): error TS2693: 'string' only refers to a type, but is being used as a value here.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,59): error TS1011: An element access expression should take an argument.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,60): error TS1005: ';' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,65): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,9): error TS2304: Cannot find name 'public'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS1005: ';' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS2304: Cannot find name 'DefaultValue'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,29): error TS2304: Cannot find name 'value'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,35): error TS1109: Expression expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2693: 'string' only refers to a type, but is being used as a value here.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,55): error TS1005: ';' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected.
==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (90 errors) ====
declare module "fs" {
export class File {
constructor(filename: string);
public ReadAllText(): string;
}
export interface IFile {
[index: number]: string;
}
}
import fs = module("fs");
~~~~~~
!!! error TS2503: Cannot find namespace 'module'.
~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
~
!!! error TS1005: ';' expected.
module TypeScriptAllInOne {
export class Program {
static Main(...args: string[]) {
try {
var bfs = new BasicFeatures();
var retValue: number = 0;
retValue = bfs.VARIABLES();
if (retValue != 0 ^= {
~~
!!! error TS1005: ')' expected.
~
return 1;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~
!!! error TS1005: ':' expected.
~
!!! error TS1005: ',' expected.
}
~~~~~~~~~~~~~~~~~
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
case = bfs.STATEMENTS(4);
~~~~
!!! error TS1128: Declaration or statement expected.
~~~
!!! error TS2304: Cannot find name 'bfs'.
if (retValue != 0) {
~~
!!! error TS1005: ',' expected.
~
!!! error TS1005: ';' expected.
return 1;
^
~
!!! error TS1109: Expression expected.
retValue = bfs.TYPES();
~~~~~~~~
!!! error TS2304: Cannot find name 'retValue'.
~
!!! error TS1005: ';' expected.
~~~
!!! error TS2304: Cannot find name 'bfs'.
if (retValue != 0) {
~~~~~~~~
!!! error TS2304: Cannot find name 'retValue'.
return 1 &&
}
~
!!! error TS1109: Expression expected.
retValue = bfs.OPERATOR ' );
~~~~~~~~
!!! error TS2304: Cannot find name 'retValue'.
~~~
!!! error TS2304: Cannot find name 'bfs'.
~~~~
!!! error TS1005: ';' expected.
!!! error TS1002: Unterminated string literal.
if (retValue != 0) {
~~~~~~~~
!!! error TS2304: Cannot find name 'retValue'.
return 1;
}
}
catch (e) {
~~~~~
!!! error TS1005: 'try' expected.
console.log(e);
~~~~~~~
!!! error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
}
finally {
}
console.log('Done');
~~~~~~~
!!! error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
return 0;
}
}
~
!!! error TS1128: Declaration or statement expected.
class BasicFeatures {
/// <summary>
/// Test various of variables. Including nullable,key world as variable,special format
/// </summary>
/// <returns></returns>
public VARIABLES(): number {
var local = Number.MAX_VALUE;
var min = Number.MIN_VALUE;
var inf = Number.NEGATIVE_INFINITY -
var nan = Number.NaN;
~~~
!!! error TS1109: Expression expected.
var undef = undefined;
var _\uD4A5\u7204\uC316\uE59F = local;
!!! error TS1127: Invalid character.
var мир = local;
var local5 = <fs.File>null;
var local6 = local5 instanceof fs.File;
var hex = 0xBADC0DE, Hex = 0XDEADBEEF;
var float = 6.02e23, float2 = 6.02E-23
var char = 'c', \u0066 = '\u0066', hexchar = '\x42' !=
var quoted = '"', quoted2 = "'";
~~~
!!! error TS1109: Expression expected.
var reg = /\w*/;
var objLit = { "var": number = 42, equals: function (x) { return x["var"] === 42; }, instanceof : () => 'objLit{42}' };
var weekday = Weekdays.Monday;
var con = char + f + hexchar + float.toString() + float2.toString() + reg.toString() + objLit + weekday;
//
var any = 0 ^=
~
!!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
var bool = 0;
~~~
!!! error TS1109: Expression expected.
var declare = 0;
var constructor = 0;
var get = 0;
var implements = 0;
var interface = 0;
var let = 0;
var module = 0;
var number = 0;
var package = 0;
var private = 0;
var protected = 0;
var public = 0;
var set = 0;
var static = 0;
var string = 0 />
~
!!! error TS1109: Expression expected.
var yield = 0;
~~~
!!! error TS1109: Expression expected.
var sum3 = any + bool + declare + constructor + get + implements + interface + let + module + number + package + private + protected + public + set + static + string + yield;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'.
return 0;
}
/// <summary>
/// Test different statements. Including if-else,swith,foreach,(un)checked,lock,using,try-catch-finally
/// </summary>
/// <param name="i"></param>
/// <returns></returns>
STATEMENTS(i: number): number {
var retVal = 0;
if (i == 1)
retVal = 1;
else
retVal = 0;
switch (i) {
case 2:
retVal = 1;
break;
case 3:
retVal = 1;
break;
default:
break;
}
for (var x in { x: 0, y: 1 }) {
!
try {
~~~
!!! error TS1109: Expression expected.
throw null;
}
catch (Exception) ?
~
!!! error TS1005: '{' expected.
}
finally {
~~~~~~~
!!! error TS1005: 'try' expected.
try { }
catch (Exception) { }
}
return retVal;
}
/// <summary>
/// Test types in ts language. Including class,struct,interface,delegate,anonymous type
/// </summary>
/// <returns></returns>
public TYPES(): number {
var retVal = 0;
var c = new CLASS();
var xx: IF = c;
retVal += catch .Property;
~~~~~
!!! error TS1109: Expression expected.
~
!!! error TS1005: '{' expected.
~~~~~~~~
!!! error TS2304: Cannot find name 'Property'.
retVal += c.Member();
retVal += xx.Foo() ? 0 : 1;
//anonymous type
var anony = { a: new CLASS() };
retVal += anony.a.d();
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'.
return retVal;
}
///// <summary>
///// Test different operators
///// </summary>
///// <returns></returns>
public OPERATOR(): number {
var a: number[] = [1, 2, 3, 4, 5, ];/*[] bug*/ // YES []
var i = a[1];/*[]*/
i = i + i - i * i / i % i & i | i ^ i;/*+ - * / % & | ^*/
var b = true && false || true ^ false;/*& | ^*/
~~~~~~~~~~~~
!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
b = !b;/*!*/
~
!!! error TS2322: Type 'boolean' is not assignable to type 'number'.
i = ~i;/*~i*/
b = i < (i - 1) && (i + 1) > i;/*< && >*/
~
!!! error TS2322: Type 'boolean' is not assignable to type 'number'.
var f = true ? 1 : 0;/*? :*/ // YES :
i++;/*++*/
i--;/*--*/
b = true && false || true;/*&& ||*/
~
!!! error TS2322: Type 'boolean' is not assignable to type 'number'.
i = i << 5;/*<<*/
i = i >> 5;/*>>*/
var j = i;
b = i == j && i != j && i <= j && i >= j;/*= == && != <= >=*/
~
!!! error TS2322: Type 'boolean' is not assignable to type 'number'.
i += <number>5.0;/*+=*/
i -= i;/*-=*/
i *= i;/**=*/
if (i == 0)
i++;
i /= i;/*/=*/
i %= i;/*%=*/
i &= i;/*&=*/
i |= i;/*|=*/
i ^= i;/*^=*/
i <<= i;/*<<=*/
i >>= i;/*>>=*/
if (i == 0 && != b && f == 1)
~~
!!! error TS1109: Expression expected.
return 0;
else return 1;
}
}
interface IF {
Foo(): bool;
~~~~
!!! error TS2304: Cannot find name 'bool'.
}
class CLASS implements IF {
case d = () => { yield 0; };
~~~~
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
public get Property() { return 0; }
public Member() {
return 0;
}
public Foo(): bool {
~~~~
!!! error TS2304: Cannot find name 'bool'.
var myEvent = () => { return 1; };
if (myEvent() == 1)
return true ?
else
~~~~
!!! error TS1109: Expression expected.
return false;
}
}
// todo: use these
class A .
~
!!! error TS1005: '{' expected.
public method1(val:number) {
~~~~~~
!!! error TS1128: Declaration or statement expected.
~~~~~~~
!!! error TS2304: Cannot find name 'method1'.
~~~
!!! error TS2304: Cannot find name 'val'.
~
!!! error TS1005: ',' expected.
~~~~~~
!!! error TS2693: 'number' only refers to a type, but is being used as a value here.
~
!!! error TS1005: ';' expected.
return val;
}
public method2() {
~~~~~~
!!! error TS1128: Declaration or statement expected.
~~~~~~~
!!! error TS2304: Cannot find name 'method2'.
~
!!! error TS1005: ';' expected.
return 2 * this.method1(2);
}
}
~
!!! error TS1128: Declaration or statement expected.
class B extends A {
public method2() {
return this.method1(2);
~~~~~~~
!!! error TS2551: Property 'method1' does not exist on type 'B'. Did you mean 'method2'?
!!! related TS2728 tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts:245:16: 'method2' is declared here.
}
}
class Overloading {
private otherValue = 42;
constructor(private value: number, public name: string) : }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2390: Constructor implementation is missing.
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~~~~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~
!!! error TS1110: Type expected.
public Overloads(value: string);
~~~~~~
!!! error TS1128: Declaration or statement expected.
~~~~~~~~~
!!! error TS2304: Cannot find name 'Overloads'.
~~~~~
!!! error TS2304: Cannot find name 'value'.
~
!!! error TS1005: ',' expected.
~~~~~~
!!! error TS2693: 'string' only refers to a type, but is being used as a value here.
public Overloads( while : string, ...rest: string[]) { &
~~~~~~
!!! error TS1128: Declaration or statement expected.
~~~~~~~~~
!!! error TS2304: Cannot find name 'Overloads'.
~~~~~
!!! error TS1135: Argument expression expected.
~
!!! error TS1005: '(' expected.
~~~~~~
!!! error TS2693: 'string' only refers to a type, but is being used as a value here.
~~~
!!! error TS1109: Expression expected.
~~~~~~
!!! error TS2693: 'string' only refers to a type, but is being used as a value here.
!!! error TS1011: An element access expression should take an argument.
~
!!! error TS1005: ';' expected.
~
!!! error TS1109: Expression expected.
public DefaultValue(value?: string = "Hello") { }
~~~~~~
!!! error TS2304: Cannot find name 'public'.
~~~~~~~~~~~~
!!! error TS1005: ';' expected.
~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'DefaultValue'.
~~~~~
!!! error TS2304: Cannot find name 'value'.
~
!!! error TS1109: Expression expected.
~~~~~~
!!! error TS2693: 'string' only refers to a type, but is being used as a value here.
~
!!! error TS1005: ';' expected.
}
}
~
!!! error TS1128: Declaration or statement expected.
enum Weekdays {
Monday,
Tuesday,
Weekend,
}
enum Fruit {
Apple,
Pear
}
interface IDisposable {
Dispose(): void;
}
TypeScriptAllInOne.Program.Main();