File tree 2 files changed +2
-2
lines changed 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -14744,7 +14744,7 @@ namespace ts {
14744
14744
function checkDeclarationInitializer(declaration: VariableLikeDeclaration) {
14745
14745
const type = checkExpressionCached(declaration.initializer);
14746
14746
return getCombinedNodeFlags(declaration) & NodeFlags.Const ||
14747
- getCombinedModifierFlags(declaration) & ModifierFlags.Readonly ||
14747
+ getCombinedModifierFlags(declaration) & ModifierFlags.Readonly && !isParameterPropertyDeclaration(declaration) ||
14748
14748
isTypeAssertion(declaration.initializer) ? type : getWidenedLiteralType(type);
14749
14749
}
14750
14750
Original file line number Diff line number Diff line change @@ -4497,7 +4497,7 @@ namespace ts {
4497
4497
}
4498
4498
}
4499
4499
4500
- export function isParameterPropertyDeclaration ( node : ParameterDeclaration ) : boolean {
4500
+ export function isParameterPropertyDeclaration ( node : Node ) : boolean {
4501
4501
return hasModifier ( node , ModifierFlags . ParameterPropertyModifier ) && node . parent . kind === SyntaxKind . Constructor && isClassLike ( node . parent . parent ) ;
4502
4502
}
4503
4503
You can’t perform that action at this time.
0 commit comments