diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 28b14502af9..a459db40e1b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3206,7 +3206,8 @@ namespace ts { // Use the type of the initializer expression if one is present if (declaration.initializer) { const type = checkDeclarationInitializer(declaration); - return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality); + const isOptional = declaration.questionToken || (declaration.initializer && declaration.kind === SyntaxKind.Parameter); + return addOptionality(type, isOptional && includeOptionality); } // If it is a short-hand property assignment, use the type of the identifier