File: optionalPropertiesSyntax.errors.txt

package info (click to toggle)
node-typescript 4.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 396,552 kB
  • sloc: javascript: 1,444,377; makefile: 7; sh: 3
file content (86 lines) | stat: -rw-r--r-- 3,716 bytes parent folder | download | duplicates (4)
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
tests/cases/compiler/optionalPropertiesSyntax.ts(4,5): error TS2386: Overload signatures must all be optional or required.
tests/cases/compiler/optionalPropertiesSyntax.ts(11,7): error TS1005: ';' expected.
tests/cases/compiler/optionalPropertiesSyntax.ts(11,8): error TS1131: Property or signature expected.
tests/cases/compiler/optionalPropertiesSyntax.ts(12,5): error TS1131: Property or signature expected.
tests/cases/compiler/optionalPropertiesSyntax.ts(18,11): error TS1005: ';' expected.
tests/cases/compiler/optionalPropertiesSyntax.ts(18,12): error TS1131: Property or signature expected.
tests/cases/compiler/optionalPropertiesSyntax.ts(24,5): error TS2300: Duplicate identifier 'prop'.
tests/cases/compiler/optionalPropertiesSyntax.ts(24,5): error TS2687: All declarations of 'prop' must have identical modifiers.
tests/cases/compiler/optionalPropertiesSyntax.ts(25,5): error TS2300: Duplicate identifier 'prop'.
tests/cases/compiler/optionalPropertiesSyntax.ts(25,5): error TS2687: All declarations of 'prop' must have identical modifiers.
tests/cases/compiler/optionalPropertiesSyntax.ts(32,5): error TS2375: Duplicate number index signature.
tests/cases/compiler/optionalPropertiesSyntax.ts(32,18): error TS1005: ';' expected.
tests/cases/compiler/optionalPropertiesSyntax.ts(32,19): error TS1131: Property or signature expected.
tests/cases/compiler/optionalPropertiesSyntax.ts(33,5): error TS1131: Property or signature expected.
tests/cases/compiler/optionalPropertiesSyntax.ts(33,7): error TS2375: Duplicate number index signature.
tests/cases/compiler/optionalPropertiesSyntax.ts(34,5): error TS2375: Duplicate number index signature.


==== tests/cases/compiler/optionalPropertiesSyntax.ts (16 errors) ====
    interface fnSigs {
        //functions signatures can be optional
        fn(): void;
        fn?(): void; //err
        ~~
!!! error TS2386: Overload signatures must all be optional or required.
        fn2?(): void;
    }
    
    interface callSig {
        //Call signatures can't be optional
        (): any;
        ()?: any; //err
          ~
!!! error TS1005: ';' expected.
           ~
!!! error TS1131: Property or signature expected.
        ?(): any; //err
        ~
!!! error TS1131: Property or signature expected.
    }
    
    interface constructSig {
        //Construct signatures can't be optional
        new (): any;
        new ()?: any; //err
              ~
!!! error TS1005: ';' expected.
               ~
!!! error TS1131: Property or signature expected.
        new ?(): any; //err
    }
    
    interface propertySig {
        //Property signatures can be optional
        prop: any;
        ~~~~
!!! error TS2300: Duplicate identifier 'prop'.
        ~~~~
!!! error TS2687: All declarations of 'prop' must have identical modifiers.
        prop?: any;
        ~~~~
!!! error TS2300: Duplicate identifier 'prop'.
        ~~~~
!!! error TS2687: All declarations of 'prop' must have identical modifiers.
        prop2?: any;
    }
    
    interface indexSig {
        //Index signatures can't be optional
        [idx: number]: any;
        [idx: number]?: any; //err
        ~~~~~~~~~~~~~
!!! error TS2375: Duplicate number index signature.
                     ~
!!! error TS1005: ';' expected.
                      ~
!!! error TS1131: Property or signature expected.
        ? [idx: number]: any; //err
        ~
!!! error TS1131: Property or signature expected.
          ~~~~~~~~~~~~~~~~~~~
!!! error TS2375: Duplicate number index signature.
        [idx?: number]: any; //err
        ~~~~~~~~~~~~~~~~~~~~
!!! error TS2375: Duplicate number index signature.
    }