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

74 lines
3.3 KiB
Plaintext
Raw Normal View History

tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(9,7): error TS2420: Class 'Bar' incorrectly implements interface 'I'.
2014-09-19 23:01:07 +02:00
Property 'y' is missing in type 'Bar'.
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(12,7): error TS2420: Class 'Bar2' incorrectly implements interface 'I'.
2014-09-19 23:01:07 +02:00
Property 'x' is missing in type 'Bar2'.
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(16,7): error TS2420: Class 'Bar3' incorrectly implements interface 'I'.
2014-09-19 23:01:07 +02:00
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'.
2014-09-19 23:01:07 +02:00
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'.
2014-09-19 23:01:07 +02:00
Property 'y' is missing in type 'Bar5'.
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(29,7): error TS2420: Class 'Bar6' incorrectly implements interface 'I'.
2014-09-19 23:01:07 +02:00
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: Property 'y' is missing in type 'Bar'.
2014-09-19 23:01:07 +02:00
}
class Bar2 implements I { // error
~~~~
!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'.
!!! error TS2420: Property 'x' is missing in type 'Bar2'.
2014-09-19 23:01:07 +02:00
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'.
2014-09-19 23:01:07 +02:00
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'.
2014-09-19 23:01:07 +02:00
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 'Bar5'.
2014-09-19 23:01:07 +02:00
}
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'.
2014-09-19 23:01:07 +02:00
protected y: number;
}
class Bar7 extends Foo implements I {
y: number;
}
class Bar8 extends Foo implements I {
x: string;
y: number;
}