mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-23 07:07:09 -05:00
Actually instantiate the type of the annotation used for contextual types (#45285)
This commit is contained in:
@@ -25413,7 +25413,7 @@ namespace ts {
|
||||
// We avoid calling back into `getTypeOfExpression` and reentering contextual typing to avoid a bogus circularity error in that case.
|
||||
if (decl && (isPropertyDeclaration(decl) || isPropertySignature(decl))) {
|
||||
const overallAnnotation = getEffectiveTypeAnnotationNode(decl);
|
||||
return (overallAnnotation && getTypeFromTypeNode(overallAnnotation)) ||
|
||||
return (overallAnnotation && instantiateType(getTypeFromTypeNode(overallAnnotation), getSymbolLinks(lhsSymbol).mapper)) ||
|
||||
(decl.initializer && getTypeOfExpression(binaryExpression.left));
|
||||
}
|
||||
if (kind === AssignmentDeclarationKind.None) {
|
||||
|
||||
Reference in New Issue
Block a user