TypeScript/tests/cases/compiler/doNotInferUnrelatedTypes.ts

7 lines
174 B
TypeScript
Raw Normal View History

2017-08-03 18:14:59 +02:00
// #16709
declare function dearray<T>(ara: ReadonlyArray<T>): T;
type LiteralType = "foo" | "bar";
declare var alt: Array<LiteralType>;
let foo: LiteralType = dearray(alt);