Files
tsgo/testdata/baselines/reference/submodule/conformance/interfaceExtendingClassWithProtecteds.errors.txt

26 lines
978 B
Plaintext

interfaceExtendingClassWithProtecteds.ts(5,11): error TS2430: Interface 'I' incorrectly extends interface 'Foo'.
Property 'x' is protected but type 'I' is not a class derived from 'Foo'.
interfaceExtendingClassWithProtecteds.ts(15,12): error TS2445: Property 'x' is protected and only accessible within class 'Foo' and its subclasses.
==== interfaceExtendingClassWithProtecteds.ts (2 errors) ====
class Foo {
protected x!: string;
}
interface I extends Foo { // error
~
!!! error TS2430: Interface 'I' incorrectly extends interface 'Foo'.
!!! error TS2430: Property 'x' is protected but type 'I' is not a class derived from 'Foo'.
x: string;
}
interface I2 extends Foo {
y: string;
}
declare var i: I2;
var r = i.y;
var r2 = i.x; // error
~
!!! error TS2445: Property 'x' is protected and only accessible within class 'Foo' and its subclasses.