File: interfaceMemberValidation.errors.txt

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (27 lines) | stat: -rw-r--r-- 1,255 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
tests/cases/compiler/interfaceMemberValidation.ts(2,11): error TS2430: Interface 'i2' incorrectly extends interface 'i1'.
  Types of property 'name' are incompatible.
    Type 'number' is not assignable to type 'string'.
tests/cases/compiler/interfaceMemberValidation.ts(5,2): error TS2411: Property 'bar' of type '{ (): any; (): any; }' is not assignable to string index type 'number'.
tests/cases/compiler/interfaceMemberValidation.ts(10,2): error TS2374: Duplicate string index signature.


==== tests/cases/compiler/interfaceMemberValidation.ts (3 errors) ====
    interface i1 { name: string; }
    interface i2 extends i1 { name: number; yo: string; }
              ~~
!!! error TS2430: Interface 'i2' incorrectly extends interface 'i1'.
!!! error TS2430:   Types of property 'name' are incompatible.
!!! error TS2430:     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.
    }