mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Fixes #17080
Changes are in src/compiler.checker.ts only The second arguments to the function "removeOptionalityFromDeclaredType" has been changed from "getRootDeclaration(declaration)" to "declaration".
This commit is contained in:
@@ -13046,7 +13046,7 @@ namespace ts {
|
||||
node.parent.kind === SyntaxKind.NonNullExpression ||
|
||||
declaration.kind === SyntaxKind.VariableDeclaration && (<VariableDeclaration>declaration).exclamationToken ||
|
||||
declaration.flags & NodeFlags.Ambient;
|
||||
const initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, getRootDeclaration(declaration) as VariableLikeDeclaration) : type) :
|
||||
const initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration as VariableLikeDeclaration) : type) :
|
||||
type === autoType || type === autoArrayType ? undefinedType :
|
||||
getOptionalType(type);
|
||||
const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized);
|
||||
|
||||
Reference in New Issue
Block a user