fix(53722): Overloaded constructors: 'TValue' not assignable to 'string' (#53742)

This commit is contained in:
Oleksandr T
2023-04-20 16:32:23 -07:00
committed by GitHub
parent c74efad46e
commit 58a5f4e228
4 changed files with 87 additions and 2 deletions
+3 -2
View File
@@ -14543,8 +14543,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
}
const classType = declaration.kind === SyntaxKind.Constructor ?
getDeclaredTypeOfClassOrInterface(getMergedSymbol((declaration.parent as ClassDeclaration).symbol))
const hostDeclaration = isJSDocSignature(declaration) ? getEffectiveJSDocHost(declaration) : declaration;
const classType = hostDeclaration && isConstructorDeclaration(hostDeclaration) ?
getDeclaredTypeOfClassOrInterface(getMergedSymbol((hostDeclaration.parent as ClassDeclaration).symbol))
: undefined;
const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);
if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {