TypeScript/tests/baselines/reference/interfaceExtendingClassWithPrivates.errors.txt

26 lines
1 KiB
Plaintext
Raw Normal View History

tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts(5,11): error TS2430: Interface 'I' incorrectly extends interface 'Foo'.
Property 'x' is private in type 'Foo' but not in type 'I'.
2014-09-19 15:37:55 +02:00
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts(15,10): error TS2341: Property 'x' is private and only accessible within class 'Foo'.
2014-07-13 01:04:16 +02:00
==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts (2 errors) ====
class Foo {
private x: string;
}
interface I extends Foo { // error
~
!!! error TS2430: Interface 'I' incorrectly extends interface 'Foo'.
!!! error TS2430: Property 'x' is private in type 'Foo' but not in type 'I'.
2014-07-13 01:04:16 +02:00
x: string;
}
interface I2 extends Foo {
y: string;
}
var i: I2;
var r = i.y;
var r2 = i.x; // error
~~~
2014-09-19 15:37:55 +02:00
!!! error TS2341: Property 'x' is private and only accessible within class 'Foo'.