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
|
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(31,5): error TS2374: Duplicate index signature for type 'number'.
tests/cases/compiler/optionalPropertiesSyntax.ts(32,5): error TS2374: Duplicate index signature for type 'number'.
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 TS2374: Duplicate index signature for type 'number'.
tests/cases/compiler/optionalPropertiesSyntax.ts(34,5): error TS2374: Duplicate index signature for type 'number'.
==== tests/cases/compiler/optionalPropertiesSyntax.ts (17 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;
~~~~~~~~~~~~~~~~~~~
!!! error TS2374: Duplicate index signature for type 'number'.
[idx: number]?: any; //err
~~~~~~~~~~~~~
!!! error TS2374: Duplicate index signature for type 'number'.
~
!!! error TS1005: ';' expected.
~
!!! error TS1131: Property or signature expected.
? [idx: number]: any; //err
~
!!! error TS1131: Property or signature expected.
~~~~~~~~~~~~~~~~~~~
!!! error TS2374: Duplicate index signature for type 'number'.
[idx?: number]: any; //err
~~~~~~~~~~~~~~~~~~~~
!!! error TS2374: Duplicate index signature for type 'number'.
}
|