2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/interfaceDeclaration1.ts (6 errors) ====
|
|
|
|
interface I1 {
|
|
|
|
item:number;
|
|
|
|
item:number;
|
|
|
|
~~~~
|
|
|
|
!!! Duplicate identifier 'item'.
|
|
|
|
}
|
|
|
|
|
|
|
|
interface I2 {
|
|
|
|
item:any;
|
|
|
|
item:number;
|
|
|
|
~~~~
|
|
|
|
!!! Duplicate identifier 'item'.
|
|
|
|
}
|
|
|
|
|
|
|
|
interface I3 {
|
|
|
|
prototype:number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface I4 {
|
|
|
|
class:number;
|
|
|
|
number:number;
|
|
|
|
super:number;
|
|
|
|
prototype:number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface I5 extends I5 {
|
2014-07-19 02:30:06 +02:00
|
|
|
~~
|
|
|
|
!!! Type 'I5' recursively references itself as a base type.
|
2014-07-13 01:04:16 +02:00
|
|
|
foo():void;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface I6 {
|
|
|
|
():void;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface I7 extends I6 { }
|
|
|
|
|
|
|
|
var v1:I7;
|
|
|
|
v1();
|
|
|
|
|
|
|
|
class C1 implements I3 {
|
|
|
|
~~
|
|
|
|
!!! Class 'C1' incorrectly implements interface 'I3':
|
|
|
|
!!! Property 'prototype' is missing in type 'C1'.
|
|
|
|
constructor() {
|
|
|
|
var prototype: number = 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
interface i8 extends i9 { }
|
2014-07-19 02:30:06 +02:00
|
|
|
~~
|
2014-07-13 01:04:16 +02:00
|
|
|
!!! Type 'i8' recursively references itself as a base type.
|
|
|
|
interface i9 extends i8 { }
|
|
|
|
|
|
|
|
interface i10 {
|
|
|
|
foo():number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface i11{
|
|
|
|
foo():string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface i12 extends i10, i11 { }
|
|
|
|
~~~
|
|
|
|
!!! Interface 'i12' cannot simultaneously extend types 'i10' and 'i11':
|
|
|
|
!!! Named properties 'foo' of types 'i10' and 'i11' are not identical.
|
|
|
|
|