File: typeQueryOnClass.errors.txt

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (77 lines) | stat: -rw-r--r-- 2,780 bytes parent folder | download | duplicates (6)
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
tests/cases/conformance/types/specifyingTypes/typeQueries/typeQueryOnClass.ts(15,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/types/specifyingTypes/typeQueries/typeQueryOnClass.ts(18,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/types/specifyingTypes/typeQueries/typeQueryOnClass.ts(21,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/types/specifyingTypes/typeQueries/typeQueryOnClass.ts(30,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/types/specifyingTypes/typeQueries/typeQueryOnClass.ts(33,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/types/specifyingTypes/typeQueries/typeQueryOnClass.ts(36,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.


==== tests/cases/conformance/types/specifyingTypes/typeQueries/typeQueryOnClass.ts (6 errors) ====
    class C<T> {
        constructor(x: number);
        constructor(x: string);
        constructor(public x) { }
    
        static foo(x: number);
        static foo(x: {});
        static foo(x) { }
    
        static bar(x) { }
    
        static sa = 1;
        static sb = () => 1;
    
        static get sc() {
                   ~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
            return 1;
        }
        static set sc(x) {
                   ~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
        }
    
        static get sd() {
                   ~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
            return 1;
        }
    
        baz(x): string { return ''; }
    
        ia = 1;
        ib = () => this.ia;
    
        get ic() {
            ~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
            return 1;
        }
        set ic(x) {
            ~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
        }
    
        get id() {
            ~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
            return 1;
        }
    
    }
    
    var c: C<string>;
    
    // BUG 820454
    var r1: typeof C;
    var r2: typeof c;
    
    class D<T> {
        constructor(public y?) { }
        x: T;
        foo() { }
    }
    
    var d: D<string>;
    var r3: typeof D;
    var r4: typeof d;