70 lines
847 B
Text
70 lines
847 B
Text
=== tests/cases/compiler/bestCommonTypeWithOptionalProperties.ts ===
|
|
interface X { foo: string }
|
|
>X : X
|
|
>foo : string
|
|
|
|
interface Y extends X { bar?: number }
|
|
>Y : Y
|
|
>X : X
|
|
>bar : number
|
|
|
|
interface Z extends X { bar: string }
|
|
>Z : Z
|
|
>X : X
|
|
>bar : string
|
|
|
|
var x: X;
|
|
>x : X
|
|
>X : X
|
|
|
|
var y: Y;
|
|
>y : Y
|
|
>Y : Y
|
|
|
|
var z: Z;
|
|
>z : Z
|
|
>Z : Z
|
|
|
|
// All these arrays should be X[]
|
|
var b1 = [x, y, z];
|
|
>b1 : X[]
|
|
>[x, y, z] : X[]
|
|
>x : X
|
|
>y : Y
|
|
>z : Z
|
|
|
|
var b2 = [x, z, y];
|
|
>b2 : X[]
|
|
>[x, z, y] : X[]
|
|
>x : X
|
|
>z : Z
|
|
>y : Y
|
|
|
|
var b3 = [y, x, z];
|
|
>b3 : X[]
|
|
>[y, x, z] : X[]
|
|
>y : Y
|
|
>x : X
|
|
>z : Z
|
|
|
|
var b4 = [y, z, x];
|
|
>b4 : X[]
|
|
>[y, z, x] : X[]
|
|
>y : Y
|
|
>z : Z
|
|
>x : X
|
|
|
|
var b5 = [z, x, y];
|
|
>b5 : X[]
|
|
>[z, x, y] : X[]
|
|
>z : Z
|
|
>x : X
|
|
>y : Y
|
|
|
|
var b6 = [z, y, x];
|
|
>b6 : X[]
|
|
>[z, y, x] : X[]
|
|
>z : Z
|
|
>y : Y
|
|
>x : X
|
|
|