TypeScript/tests/cases/compiler/typeofStripsFreshness.ts
Wesley Wigham 547856a11d
Strip literal freshness from type queries (#25471)
* Strip literal freshness from type queries

* Rename to fix typo
2018-07-06 13:07:29 -07:00

20 lines
402 B
TypeScript

interface Collection<T> {
elems: T[];
}
interface CollectionStatic {
new <T>(): Collection<T>;
}
declare const Collection: CollectionStatic;
const ALL = "all";
type All = typeof ALL;
const result: Collection<All> = new Collection();
const ANOTHER = "another";
type Another = typeof ANOTHER;
type Both = Another | All;
const result2: Collection<Both> = new Collection();