Closed
Description
cc @ahejlsberg
TypeScript Version: 2.7.0-dev.20180206
Search Terms:
Code
type Call<T extends () => any> = T extends () => infer R ? R : never;
type Cast<T> = Call<CastMap<T>>;
interface CastMap<T> {
(this: ThisType<true>): true;
(this: ThisType<false>): false;
(this: ThisType<boolean>): boolean;
(this: ThisType<void>): void;
}
type A = Cast<true>;
Expected behavior:
A
is true
.
Actual behavior:
A
is void
.
Playground Link:
Related Issues: