6e77e2e810
Also got rid of the 'terminalMessages' concept.
51 lines
2.6 KiB
Plaintext
51 lines
2.6 KiB
Plaintext
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'.
|
|
Named properties 'x' of types 'Foo' and 'Bar' are not identical.
|
|
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Bar'.
|
|
Property 'x' is protected but type 'I4' is not a class derived from 'Bar'.
|
|
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Foo'.
|
|
Property 'x' is protected but type 'I4' is not a class derived from 'Foo'.
|
|
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(26,10): error TS2445: Property 'x' is protected and only accessible within class 'Foo' and its subclasses.
|
|
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(27,10): error TS2445: Property 'y' is protected and only accessible within class 'Baz' and its subclasses.
|
|
|
|
|
|
==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts (5 errors) ====
|
|
class Foo {
|
|
protected x: string;
|
|
}
|
|
|
|
class Bar {
|
|
protected x: string;
|
|
}
|
|
|
|
interface I3 extends Foo, Bar { // error
|
|
~~
|
|
!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'.
|
|
!!! error TS2320: Named properties 'x' of types 'Foo' and 'Bar' are not identical.
|
|
}
|
|
|
|
interface I4 extends Foo, Bar { // error
|
|
~~
|
|
!!! error TS2430: Interface 'I4' incorrectly extends interface 'Bar'.
|
|
!!! error TS2430: Property 'x' is protected but type 'I4' is not a class derived from 'Bar'.
|
|
~~
|
|
!!! error TS2430: Interface 'I4' incorrectly extends interface 'Foo'.
|
|
!!! error TS2430: Property 'x' is protected but type 'I4' is not a class derived from 'Foo'.
|
|
x: string;
|
|
}
|
|
|
|
class Baz {
|
|
protected y: string;
|
|
}
|
|
|
|
interface I5 extends Foo, Baz {
|
|
z: string;
|
|
}
|
|
|
|
var i: I5;
|
|
var r: string = i.z;
|
|
var r2 = i.x; // error
|
|
~~~
|
|
!!! error TS2445: Property 'x' is protected and only accessible within class 'Foo' and its subclasses.
|
|
var r3 = i.y; // error
|
|
~~~
|
|
!!! error TS2445: Property 'y' is protected and only accessible within class 'Baz' and its subclasses. |