* Relate non-augmenting array subtypes without resorting to structural comparison
* Fix lint
* Generalize performance enhancement
* Cache results, feed through via getNormalizedType to remove error intermediates
* Use newly freed up object flags to limit member setting, fix crash with those object flags
* Move flags because there is no TypeFlags.Reference 🤦
76 lines
3.8 KiB
Plaintext
76 lines
3.8 KiB
Plaintext
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(9,7): error TS2420: Class 'Bar' incorrectly implements interface 'I'.
|
|
Type 'Bar' is missing the following properties from type 'I': y, x
|
|
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(12,7): error TS2420: Class 'Bar2' incorrectly implements interface 'I'.
|
|
Property 'x' is missing in type 'Bar2' but required in type 'I'.
|
|
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(16,7): error TS2420: Class 'Bar3' incorrectly implements interface 'I'.
|
|
Property 'x' is protected but type 'Bar3' is not a class derived from 'Foo'.
|
|
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(21,7): error TS2420: Class 'Bar4' incorrectly implements interface 'I'.
|
|
Property 'x' is protected but type 'Bar4' is not a class derived from 'Foo'.
|
|
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(26,7): error TS2420: Class 'Bar5' incorrectly implements interface 'I'.
|
|
Property 'y' is missing in type 'Foo' but required in type 'I'.
|
|
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(29,7): error TS2420: Class 'Bar6' incorrectly implements interface 'I'.
|
|
Property 'y' is protected in type 'Bar6' but public in type 'I'.
|
|
|
|
|
|
==== tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts (6 errors) ====
|
|
class Foo {
|
|
protected x: string;
|
|
}
|
|
|
|
interface I extends Foo {
|
|
y: number;
|
|
}
|
|
|
|
class Bar implements I { // error
|
|
~~~
|
|
!!! error TS2420: Class 'Bar' incorrectly implements interface 'I'.
|
|
!!! error TS2420: Type 'Bar' is missing the following properties from type 'I': y, x
|
|
}
|
|
|
|
class Bar2 implements I { // error
|
|
~~~~
|
|
!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'.
|
|
!!! error TS2420: Property 'x' is missing in type 'Bar2' but required in type 'I'.
|
|
!!! related TS2728 tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts:2:15: 'x' is declared here.
|
|
y: number;
|
|
}
|
|
|
|
class Bar3 implements I { // error
|
|
~~~~
|
|
!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'.
|
|
!!! error TS2420: Property 'x' is protected but type 'Bar3' is not a class derived from 'Foo'.
|
|
x: string;
|
|
y: number;
|
|
}
|
|
|
|
class Bar4 implements I { // error
|
|
~~~~
|
|
!!! error TS2420: Class 'Bar4' incorrectly implements interface 'I'.
|
|
!!! error TS2420: Property 'x' is protected but type 'Bar4' is not a class derived from 'Foo'.
|
|
protected x: string;
|
|
y: number;
|
|
}
|
|
|
|
class Bar5 extends Foo implements I { // error
|
|
~~~~
|
|
!!! error TS2420: Class 'Bar5' incorrectly implements interface 'I'.
|
|
!!! error TS2420: Property 'y' is missing in type 'Foo' but required in type 'I'.
|
|
!!! related TS2728 tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts:6:5: 'y' is declared here.
|
|
}
|
|
|
|
class Bar6 extends Foo implements I { // error
|
|
~~~~
|
|
!!! error TS2420: Class 'Bar6' incorrectly implements interface 'I'.
|
|
!!! error TS2420: Property 'y' is protected in type 'Bar6' but public in type 'I'.
|
|
protected y: number;
|
|
}
|
|
|
|
class Bar7 extends Foo implements I {
|
|
y: number;
|
|
}
|
|
|
|
class Bar8 extends Foo implements I {
|
|
x: string;
|
|
y: number;
|
|
}
|
|
|