20 lines
754 B
Plaintext
20 lines
754 B
Plaintext
==== tests/cases/compiler/interfaceMemberValidation.ts (3 errors) ====
|
|
interface i1 { name: string; }
|
|
interface i2 extends i1 { name: number; yo: string; }
|
|
~~
|
|
!!! error TS2429: Interface 'i2' incorrectly extends interface 'i1':
|
|
!!! error TS2429: Types of property 'name' are incompatible:
|
|
!!! error TS2429: Type 'number' is not assignable to type 'string'.
|
|
|
|
interface foo {
|
|
bar():any;
|
|
~~~~~~~~~~
|
|
!!! error TS2411: Property 'bar' of type '{ (): any; (): any; }' is not assignable to string index type 'number'.
|
|
bar():any;
|
|
new():void;
|
|
new():void;
|
|
[s:string]:number;
|
|
[s:string]:number;
|
|
~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2374: Duplicate string index signature.
|
|
} |