mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-27 22:39:59 -05:00
Merge pull request #15954 from Microsoft/typeArgs
Unconditionally compute type arguments of class base type
This commit is contained in:
@@ -4852,6 +4852,7 @@ namespace ts {
|
||||
return;
|
||||
}
|
||||
const baseTypeNode = getBaseTypeNodeOfClass(type);
|
||||
const typeArgs = typeArgumentsFromTypeReferenceNode(baseTypeNode);
|
||||
let baseType: Type;
|
||||
const originalBaseType = baseConstructorType && baseConstructorType.symbol ? getDeclaredTypeOfSymbol(baseConstructorType.symbol) : undefined;
|
||||
if (baseConstructorType.symbol && baseConstructorType.symbol.flags & SymbolFlags.Class &&
|
||||
@@ -4859,7 +4860,7 @@ namespace ts {
|
||||
// When base constructor type is a class with no captured type arguments we know that the constructors all have the same type parameters as the
|
||||
// class and all return the instance type of the class. There is no need for further checks and we can apply the
|
||||
// type arguments in the same manner as a type reference to get the same error reporting experience.
|
||||
baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol, typeArgumentsFromTypeReferenceNode(baseTypeNode));
|
||||
baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol, typeArgs);
|
||||
}
|
||||
else if (baseConstructorType.flags & TypeFlags.Any) {
|
||||
baseType = baseConstructorType;
|
||||
|
||||
Reference in New Issue
Block a user