ts
let map = new Map([["", true], ["", 0]]);
number is not assignable to booleants
type Foo = { success: boolean };
declare function bar<T>(f: () => T[]): T[];
let x: Foo[] = bar(() => Math.random() ? [{ success: true }] : [{ success: false }]);
Type '{ success: true; }[] | { success: false; }[]' is not assignable to type '{ success: true; }[]'.T, or error that there's no common supertype"strictFunctionTypes.function push<T>(arr: T[], elem: T)?class Test {
x: number = this.x;
}
x being referenced in its own initializer, but it maybe doesn't make as much sense in the presence of subtyping.! should allow you to disable the circularity error.Indeed, variance annotation would be very useful, specifically were it cannot be inferred (typically for declarations typings).
Most helpful comment
Indeed, variance annotation would be very useful, specifically were it cannot be inferred (typically for declarations typings).