TypeScript/tests/cases/compiler/bestCommonTypeWithOptionalProperties.ts
2014-07-12 17:30:19 -07:00

15 lines
304 B
TypeScript

interface X { foo: string }
interface Y extends X { bar?: number }
interface Z extends X { bar: string }
var x: X;
var y: Y;
var z: Z;
// All these arrays should be X[]
var b1 = [x, y, z];
var b2 = [x, z, y];
var b3 = [y, x, z];
var b4 = [y, z, x];
var b5 = [z, x, y];
var b6 = [z, y, x];