2014-10-28 08:28:59 +01:00
|
|
|
tests/cases/compiler/interfaceImplementation7.ts(4,11): error TS2320: Interface 'i3' cannot simultaneously extend types 'i1' and 'i2'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Named properties 'name' of types 'i1' and 'i2' are not identical.
|
2014-10-28 08:28:59 +01:00
|
|
|
tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2420: Class 'C1' incorrectly implements interface 'i4'.
|
|
|
|
Types of property 'name' are incompatible.
|
|
|
|
Type '() => string' is not assignable to type '() => { s: string; n: number; }'.
|
|
|
|
Type 'string' is not assignable to type '{ s: string; n: number; }'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Property 's' is missing in type 'String'.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/interfaceImplementation7.ts (2 errors) ====
|
|
|
|
interface i1{ name(): { s: string; }; }
|
|
|
|
interface i2{ name(): { n: number; }; }
|
|
|
|
|
|
|
|
interface i3 extends i1, i2 { }
|
|
|
|
~~
|
2014-10-28 08:28:59 +01:00
|
|
|
!!! error TS2320: Interface 'i3' cannot simultaneously extend types 'i1' and 'i2'.
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2320: Named properties 'name' of types 'i1' and 'i2' are not identical.
|
2014-07-13 01:04:16 +02:00
|
|
|
interface i4 extends i1, i2 { name(): { s: string; n: number; }; }
|
|
|
|
|
|
|
|
class C1 implements i4 {
|
|
|
|
~~
|
2014-10-28 08:28:59 +01:00
|
|
|
!!! error TS2420: Class 'C1' incorrectly implements interface 'i4'.
|
|
|
|
!!! error TS2420: Types of property 'name' are incompatible.
|
|
|
|
!!! error TS2420: Type '() => string' is not assignable to type '() => { s: string; n: number; }'.
|
|
|
|
!!! error TS2420: Type 'string' is not assignable to type '{ s: string; n: number; }'.
|
|
|
|
!!! error TS2420: Property 's' is missing in type 'String'.
|
2014-07-13 01:04:16 +02:00
|
|
|
public name(): string { return ""; }
|
|
|
|
}
|
|
|
|
|