You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
181 B
TypeScript

// new
function a(arg: unknown): asserts arg is string;
// my impl
function b<T>(arg: T): T extends string ? void : never;
declare let v: string | number;
a(v);
let x: string = v;