2014-10-28 08:28:59 +01:00
|
|
|
tests/cases/compiler/interfaceImplementation6.ts(9,7): error TS2420: Class 'C2' incorrectly implements interface 'I1'.
|
2014-09-18 02:05:45 +02:00
|
|
|
Property 'item' is private in type 'C2' but not in type 'I1'.
|
2014-10-28 08:28:59 +01:00
|
|
|
tests/cases/compiler/interfaceImplementation6.ts(13,7): error TS2420: Class 'C3' incorrectly implements interface 'I1'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Property 'item' is missing in type 'C3'.
|
|
|
|
|
|
|
|
|
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 {
|
|
|
|
~~
|
2014-10-28 08:28:59 +01:00
|
|
|
!!! error TS2420: Class 'C2' incorrectly implements interface 'I1'.
|
|
|
|
!!! error TS2420: 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 {
|
|
|
|
~~
|
2014-10-28 08:28:59 +01:00
|
|
|
!!! error TS2420: Class 'C3' incorrectly implements interface 'I1'.
|
|
|
|
!!! error TS2420: Property 'item' is missing in type 'C3'.
|
2014-07-13 01:04:16 +02:00
|
|
|
constructor() {
|
|
|
|
var item: number;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Test {
|
|
|
|
private pt: I1 = { item: 1 };
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|