Closed
Description
Sorry if this has already been submitted (was not able to find).
It would be great if TS could consider the base class from an extended generic type.
interface Type<T> {
new (...args: any[]): T;
}
function ok(type: Type<Error>) {
return type == RangeError;
}
function fail<T extends Error>(type: Type<T>) {
return type == RangeError; // Operator '==' cannot be applied to types 'Type<T>' and 'RangeErrorConstructor'.
}