TypeScript/tests/baselines/reference/subtypingWithCallSignaturesWithRestParameters.errors.txt
Daniel Rosenwasser 6e77e2e810 Removed colons from diagnostic messages.
Also got rid of the 'terminalMessages' concept.
2014-10-28 00:48:58 -07:00

257 lines
14 KiB
Plaintext

tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(18,11): error TS2430: Interface 'I1C' incorrectly extends interface 'Base'.
Types of property 'a' are incompatible.
Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'.
Types of parameters 'args' and 'args' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(34,11): error TS2430: Interface 'I3B' incorrectly extends interface 'Base'.
Types of property 'a' are incompatible.
Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'.
Types of parameters 'x' and 'args' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(60,11): error TS2430: Interface 'I6C' incorrectly extends interface 'Base'.
Types of property 'a2' are incompatible.
Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'.
Types of parameters 'args' and 'z' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(90,11): error TS2430: Interface 'I10B' incorrectly extends interface 'Base'.
Types of property 'a3' are incompatible.
Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
Types of parameters 'y' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(94,11): error TS2430: Interface 'I10C' incorrectly extends interface 'Base'.
Types of property 'a3' are incompatible.
Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
Types of parameters 'z' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(98,11): error TS2430: Interface 'I10D' incorrectly extends interface 'Base'.
Types of property 'a3' are incompatible.
Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(102,11): error TS2430: Interface 'I10E' incorrectly extends interface 'Base'.
Types of property 'a3' are incompatible.
Type '(x: number, ...z: string[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
Types of parameters 'z' and 'z' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(110,11): error TS2430: Interface 'I12' incorrectly extends interface 'Base'.
Types of property 'a4' are incompatible.
Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
Types of parameters 'y' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(118,11): error TS2430: Interface 'I14' incorrectly extends interface 'Base'.
Types of property 'a4' are incompatible.
Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
Types of parameters 'y' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(126,11): error TS2430: Interface 'I16' incorrectly extends interface 'Base'.
Types of property 'a4' are incompatible.
Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
Types of parameters 'args' and 'z' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(130,11): error TS2430: Interface 'I17' incorrectly extends interface 'Base'.
Types of property 'a4' are incompatible.
Type '(...args: number[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
Types of parameters 'args' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts (11 errors) ====
// call signatures in derived types must have the same or fewer optional parameters as the base type
interface Base {
a: (...args: number[]) => number;
a2: (x: number, ...z: number[]) => number;
a3: (x: number, y?: string, ...z: number[]) => number;
a4: (x?: number, y?: string, ...z: number[]) => number;
}
interface I1 extends Base {
a: () => number; // ok, same number of required params
}
interface I1B extends Base {
a: (...args: number[]) => number; // ok, same number of required params
}
interface I1C extends Base {
~~~
!!! error TS2430: Interface 'I1C' incorrectly extends interface 'Base'.
!!! error TS2430: Types of property 'a' are incompatible.
!!! error TS2430: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'.
!!! error TS2430: Types of parameters 'args' and 'args' are incompatible.
!!! error TS2430: Type 'string' is not assignable to type 'number'.
a: (...args: string[]) => number; // error, type mismatch
}
interface I2 extends Base {
a: (x?: number) => number; // ok, same number of required params
}
interface I2B extends Base {
a: (x?: number, y?: number, z?: number) => number; // ok, same number of required params
}
interface I3 extends Base {
a: (x: number) => number; // ok, all present params match
}
interface I3B extends Base {
~~~
!!! error TS2430: Interface 'I3B' incorrectly extends interface 'Base'.
!!! error TS2430: Types of property 'a' are incompatible.
!!! error TS2430: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'.
!!! error TS2430: Types of parameters 'x' and 'args' are incompatible.
!!! error TS2430: Type 'string' is not assignable to type 'number'.
a: (x?: string) => number; // error, incompatible type
}
interface I4 extends Base {
a2: () => number; // ok, fewer required params
}
interface I4B extends Base {
a2: (...args: number[]) => number; // ok, fewer required params
}
interface I5 extends Base {
a2: (x?: number) => number; // ok, fewer required params
}
interface I6 extends Base {
a2: (x: number) => number; // ok, same number of required params
}
interface I6B extends Base {
a2: (x: number, ...args: number[]) => number; // ok, same number of required params
}
interface I6C extends Base {
~~~
!!! error TS2430: Interface 'I6C' incorrectly extends interface 'Base'.
!!! error TS2430: Types of property 'a2' are incompatible.
!!! error TS2430: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'.
!!! error TS2430: Types of parameters 'args' and 'z' are incompatible.
!!! error TS2430: Type 'string' is not assignable to type 'number'.
a2: (x: number, ...args: string[]) => number; // error
}
interface I6D extends Base {
a2: (x: number, y: number) => number; // ok, all present params match
}
interface I6E extends Base {
a2: (x: number, y?: number) => number; // ok, same number of required params
}
interface I7 extends Base {
a3: () => number; // ok, fewer required params
}
interface I8 extends Base {
a3: (x?: number) => number; // ok, fewer required params
}
interface I9 extends Base {
a3: (x: number) => number; // ok, same number of required params
}
interface I10 extends Base {
a3: (x: number, y: string) => number; // ok, all present params match
}
interface I10B extends Base {
~~~~
!!! error TS2430: Interface 'I10B' incorrectly extends interface 'Base'.
!!! error TS2430: Types of property 'a3' are incompatible.
!!! error TS2430: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
!!! error TS2430: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2430: Type 'number' is not assignable to type 'string'.
a3: (x: number, y?: number, z?: number) => number; // error
}
interface I10C extends Base {
~~~~
!!! error TS2430: Interface 'I10C' incorrectly extends interface 'Base'.
!!! error TS2430: Types of property 'a3' are incompatible.
!!! error TS2430: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
!!! error TS2430: Types of parameters 'z' and 'y' are incompatible.
!!! error TS2430: Type 'number' is not assignable to type 'string'.
a3: (x: number, ...z: number[]) => number; // error
}
interface I10D extends Base {
~~~~
!!! error TS2430: Interface 'I10D' incorrectly extends interface 'Base'.
!!! error TS2430: Types of property 'a3' are incompatible.
!!! error TS2430: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2430: Type 'string' is not assignable to type 'number'.
a3: (x: string, y?: string, z?: string) => number; // error, incompatible types
}
interface I10E extends Base {
~~~~
!!! error TS2430: Interface 'I10E' incorrectly extends interface 'Base'.
!!! error TS2430: Types of property 'a3' are incompatible.
!!! error TS2430: Type '(x: number, ...z: string[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
!!! error TS2430: Types of parameters 'z' and 'z' are incompatible.
!!! error TS2430: Type 'string' is not assignable to type 'number'.
a3: (x: number, ...z: string[]) => number; // error
}
interface I11 extends Base {
a4: () => number; // ok, fewer required params
}
interface I12 extends Base {
~~~
!!! error TS2430: Interface 'I12' incorrectly extends interface 'Base'.
!!! error TS2430: Types of property 'a4' are incompatible.
!!! error TS2430: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
!!! error TS2430: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2430: Type 'number' is not assignable to type 'string'.
a4: (x?: number, y?: number) => number; // error, type mismatch
}
interface I13 extends Base {
a4: (x: number) => number; // ok, all present params match
}
interface I14 extends Base {
~~~
!!! error TS2430: Interface 'I14' incorrectly extends interface 'Base'.
!!! error TS2430: Types of property 'a4' are incompatible.
!!! error TS2430: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
!!! error TS2430: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2430: Type 'number' is not assignable to type 'string'.
a4: (x: number, y?: number) => number; // error, second param has type mismatch
}
interface I15 extends Base {
a4: (x?: number, y?: string) => number; // ok, same number of required params with matching types
}
interface I16 extends Base {
~~~
!!! error TS2430: Interface 'I16' incorrectly extends interface 'Base'.
!!! error TS2430: Types of property 'a4' are incompatible.
!!! error TS2430: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
!!! error TS2430: Types of parameters 'args' and 'z' are incompatible.
!!! error TS2430: Type 'string' is not assignable to type 'number'.
a4: (x: number, ...args: string[]) => number; // error, rest param has type mismatch
}
interface I17 extends Base {
~~~
!!! error TS2430: Interface 'I17' incorrectly extends interface 'Base'.
!!! error TS2430: Types of property 'a4' are incompatible.
!!! error TS2430: Type '(...args: number[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
!!! error TS2430: Types of parameters 'args' and 'y' are incompatible.
!!! error TS2430: Type 'number' is not assignable to type 'string'.
a4: (...args: number[]) => number; // error
}