54 lines
585 B
Text
54 lines
585 B
Text
|
=== tests/cases/compiler/subtypingTransitivity.ts ===
|
||
|
class B {
|
||
|
>B : B
|
||
|
|
||
|
x: Object;
|
||
|
>x : Object
|
||
|
>Object : Object
|
||
|
}
|
||
|
|
||
|
class D extends B {
|
||
|
>D : D
|
||
|
>B : B
|
||
|
|
||
|
public x: string;
|
||
|
>x : string
|
||
|
}
|
||
|
class D2 extends B {
|
||
|
>D2 : D2
|
||
|
>B : B
|
||
|
|
||
|
public x: number;
|
||
|
>x : number
|
||
|
}
|
||
|
|
||
|
var b: B;
|
||
|
>b : B
|
||
|
>B : B
|
||
|
|
||
|
var d: D;
|
||
|
>d : D
|
||
|
>D : D
|
||
|
|
||
|
var d2: D2;
|
||
|
>d2 : D2
|
||
|
>D2 : D2
|
||
|
|
||
|
d.x = '';
|
||
|
>d.x = '' : string
|
||
|
>d.x : string
|
||
|
>d : D
|
||
|
>x : string
|
||
|
|
||
|
b = d;
|
||
|
>b = d : D
|
||
|
>b : B
|
||
|
>d : D
|
||
|
|
||
|
b.x = 1; // assigned number to string
|
||
|
>b.x = 1 : number
|
||
|
>b.x : Object
|
||
|
>b : B
|
||
|
>x : Object
|
||
|
|