1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
=== 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 = '' : ""
>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 : 1
>b.x : Object
>b : B
>x : Object
>1 : 1
|