124 lines
5 KiB
Plaintext
124 lines
5 KiB
Plaintext
tests/cases/compiler/inheritance1.ts(14,7): error TS2420: Class 'ImageBase' incorrectly implements interface 'SelectableControl'.
|
|
Property 'select' is missing in type 'ImageBase'.
|
|
tests/cases/compiler/inheritance1.ts(18,7): error TS2420: Class 'Locations' incorrectly implements interface 'SelectableControl'.
|
|
Property 'state' is missing in type 'Locations'.
|
|
tests/cases/compiler/inheritance1.ts(31,1): error TS2322: Type 'Control' is not assignable to type 'Button'.
|
|
Property 'select' is missing in type 'Control'.
|
|
tests/cases/compiler/inheritance1.ts(37,1): error TS2322: Type 'Control' is not assignable to type 'TextBox'.
|
|
Property 'select' is missing in type 'Control'.
|
|
tests/cases/compiler/inheritance1.ts(40,1): error TS2322: Type 'ImageBase' is not assignable to type 'SelectableControl'.
|
|
Property 'select' is missing in type 'ImageBase'.
|
|
tests/cases/compiler/inheritance1.ts(46,1): error TS2322: Type 'Image1' is not assignable to type 'SelectableControl'.
|
|
Property 'select' is missing in type 'Image1'.
|
|
tests/cases/compiler/inheritance1.ts(52,1): error TS2322: Type 'Locations' is not assignable to type 'SelectableControl'.
|
|
Property 'state' is missing in type 'Locations'.
|
|
tests/cases/compiler/inheritance1.ts(53,1): error TS2322: Type 'Locations' is not assignable to type 'Control'.
|
|
Property 'state' is missing in type 'Locations'.
|
|
tests/cases/compiler/inheritance1.ts(55,1): error TS2322: Type 'Control' is not assignable to type 'Locations'.
|
|
Property 'select' is missing in type 'Control'.
|
|
tests/cases/compiler/inheritance1.ts(58,1): error TS2322: Type 'Locations1' is not assignable to type 'SelectableControl'.
|
|
Property 'state' is missing in type 'Locations1'.
|
|
tests/cases/compiler/inheritance1.ts(59,1): error TS2322: Type 'Locations1' is not assignable to type 'Control'.
|
|
Property 'state' is missing in type 'Locations1'.
|
|
tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not assignable to type 'Locations1'.
|
|
Property 'select' is missing in type 'Control'.
|
|
|
|
|
|
==== tests/cases/compiler/inheritance1.ts (12 errors) ====
|
|
class Control {
|
|
private state: any;
|
|
}
|
|
interface SelectableControl extends Control {
|
|
select(): void;
|
|
}
|
|
|
|
class Button extends Control implements SelectableControl {
|
|
select() { }
|
|
}
|
|
class TextBox extends Control {
|
|
select() { }
|
|
}
|
|
class ImageBase extends Control implements SelectableControl{
|
|
~~~~~~~~~
|
|
!!! error TS2420: Class 'ImageBase' incorrectly implements interface 'SelectableControl'.
|
|
!!! error TS2420: Property 'select' is missing in type 'ImageBase'.
|
|
}
|
|
class Image1 extends Control {
|
|
}
|
|
class Locations implements SelectableControl {
|
|
~~~~~~~~~
|
|
!!! error TS2420: Class 'Locations' incorrectly implements interface 'SelectableControl'.
|
|
!!! error TS2420: Property 'state' is missing in type 'Locations'.
|
|
select() { }
|
|
}
|
|
class Locations1 {
|
|
select() { }
|
|
}
|
|
var sc: SelectableControl;
|
|
var c: Control;
|
|
|
|
var b: Button;
|
|
sc = b;
|
|
c = b;
|
|
b = sc;
|
|
b = c;
|
|
~
|
|
!!! error TS2322: Type 'Control' is not assignable to type 'Button'.
|
|
!!! error TS2322: Property 'select' is missing in type 'Control'.
|
|
|
|
var t: TextBox;
|
|
sc = t;
|
|
c = t;
|
|
t = sc;
|
|
t = c;
|
|
~
|
|
!!! error TS2322: Type 'Control' is not assignable to type 'TextBox'.
|
|
!!! error TS2322: Property 'select' is missing in type 'Control'.
|
|
|
|
var i: ImageBase;
|
|
sc = i;
|
|
~~
|
|
!!! error TS2322: Type 'ImageBase' is not assignable to type 'SelectableControl'.
|
|
!!! error TS2322: Property 'select' is missing in type 'ImageBase'.
|
|
c = i;
|
|
i = sc;
|
|
i = c;
|
|
|
|
var i1: Image1;
|
|
sc = i1;
|
|
~~
|
|
!!! error TS2322: Type 'Image1' is not assignable to type 'SelectableControl'.
|
|
!!! error TS2322: Property 'select' is missing in type 'Image1'.
|
|
c = i1;
|
|
i1 = sc;
|
|
i1 = c;
|
|
|
|
var l: Locations;
|
|
sc = l;
|
|
~~
|
|
!!! error TS2322: Type 'Locations' is not assignable to type 'SelectableControl'.
|
|
!!! error TS2322: Property 'state' is missing in type 'Locations'.
|
|
c = l;
|
|
~
|
|
!!! error TS2322: Type 'Locations' is not assignable to type 'Control'.
|
|
!!! error TS2322: Property 'state' is missing in type 'Locations'.
|
|
l = sc;
|
|
l = c;
|
|
~
|
|
!!! error TS2322: Type 'Control' is not assignable to type 'Locations'.
|
|
!!! error TS2322: Property 'select' is missing in type 'Control'.
|
|
|
|
var l1: Locations1;
|
|
sc = l1;
|
|
~~
|
|
!!! error TS2322: Type 'Locations1' is not assignable to type 'SelectableControl'.
|
|
!!! error TS2322: Property 'state' is missing in type 'Locations1'.
|
|
c = l1;
|
|
~
|
|
!!! error TS2322: Type 'Locations1' is not assignable to type 'Control'.
|
|
!!! error TS2322: Property 'state' is missing in type 'Locations1'.
|
|
l1 = sc;
|
|
l1 = c;
|
|
~~
|
|
!!! error TS2322: Type 'Control' is not assignable to type 'Locations1'.
|
|
!!! error TS2322: Property 'select' is missing in type 'Control'. |