2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts (4 errors) ====
|
|
|
|
class Foo {
|
|
|
|
private x: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface I extends Foo {
|
|
|
|
y: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
class Bar implements I { // error
|
|
|
|
~~~
|
|
|
|
!!! Class 'Bar' incorrectly implements interface 'I':
|
|
|
|
!!! Property 'y' is missing in type 'Bar'.
|
|
|
|
}
|
|
|
|
|
|
|
|
class Bar2 implements I { // error
|
|
|
|
~~~~
|
|
|
|
!!! Class 'Bar2' incorrectly implements interface 'I':
|
|
|
|
!!! Property 'x' is missing in type 'Bar2'.
|
|
|
|
y: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
class Bar3 implements I { // error
|
|
|
|
~~~~
|
|
|
|
!!! Class 'Bar3' incorrectly implements interface 'I':
|
2014-09-17 19:36:32 +02:00
|
|
|
!!! Property 'x' is private in type 'I' but not in type 'Bar3'.
|
2014-07-13 01:04:16 +02:00
|
|
|
x: string;
|
|
|
|
y: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
class Bar4 implements I { // error
|
|
|
|
~~~~
|
|
|
|
!!! Class 'Bar4' incorrectly implements interface 'I':
|
2014-09-17 19:36:32 +02:00
|
|
|
!!! Types have separate declarations of a private property 'x'.
|
2014-07-13 01:04:16 +02:00
|
|
|
private x: string;
|
|
|
|
y: number;
|
|
|
|
}
|