mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
26 lines
898 B
Plaintext
26 lines
898 B
Plaintext
interfaceExtendingClassWithPrivates.ts(5,11): error TS2430: Interface 'I' incorrectly extends interface 'Foo'.
|
|
Property 'x' is private in type 'Foo' but not in type 'I'.
|
|
interfaceExtendingClassWithPrivates.ts(15,12): error TS2341: Property 'x' is private and only accessible within class 'Foo'.
|
|
|
|
|
|
==== 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'.
|
|
x: string;
|
|
}
|
|
|
|
interface I2 extends Foo {
|
|
y: string;
|
|
}
|
|
|
|
declare var i: I2;
|
|
var r = i.y;
|
|
var r2 = i.x; // error
|
|
~
|
|
!!! error TS2341: Property 'x' is private and only accessible within class 'Foo'. |