We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b33e499 commit ad1c9b9Copy full SHA for ad1c9b9
src/compiler/checker.ts
@@ -3094,7 +3094,7 @@ namespace ts {
3094
// Use the type of the initializer expression if one is present
3095
if (declaration.initializer) {
3096
const exprType = checkExpressionCached(declaration.initializer);
3097
- const type = getCombinedNodeFlags(declaration) & (NodeFlags.Const | NodeFlags.Readonly) ? exprType : getBaseTypeOfLiteralType(exprType);
+ const type = getCombinedModifierFlags(declaration) & (ModifierFlags.Const | ModifierFlags.Readonly) ? exprType : getBaseTypeOfLiteralType(exprType);
3098
return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality);
3099
}
3100
0 commit comments