2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/interfaceImplementation6.ts (2 errors) ====
|
|
|
|
interface I1 {
|
|
|
|
item:number;
|
|
|
|
}
|
|
|
|
|
|
|
|
class C1 implements I1 {
|
|
|
|
public item:number;
|
|
|
|
}
|
|
|
|
|
|
|
|
class C2 implements I1 {
|
|
|
|
~~
|
|
|
|
!!! Class 'C2' incorrectly implements interface 'I1':
|
2014-09-17 19:36:32 +02:00
|
|
|
!!! Property 'item' is private in type 'C2' but not in type 'I1'.
|
2014-07-13 01:04:16 +02:00
|
|
|
private item:number;
|
|
|
|
}
|
|
|
|
|
|
|
|
class C3 implements I1 {
|
|
|
|
~~
|
|
|
|
!!! Class 'C3' incorrectly implements interface 'I1':
|
|
|
|
!!! Property 'item' is missing in type 'C3'.
|
|
|
|
constructor() {
|
|
|
|
var item: number;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Test {
|
|
|
|
private pt: I1 = { item: 1 };
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|