From b9fa0af54cbb108602f3ca45a9984754470839e5 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 6 Sep 2016 18:44:20 -0700 Subject: [PATCH] Fixing the fix --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a7daeed2459..d6f5d2a757e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3094,7 +3094,7 @@ namespace ts { // Use the type of the initializer expression if one is present if (declaration.initializer) { const exprType = checkExpressionCached(declaration.initializer); - const type = getCombinedModifierFlags(declaration) & (ModifierFlags.Const | ModifierFlags.Readonly) ? exprType : getBaseTypeOfLiteralType(exprType); + const type = getCombinedNodeFlags(declaration) & NodeFlags.Const || getCombinedModifierFlags(declaration) & ModifierFlags.Readonly ? exprType : getBaseTypeOfLiteralType(exprType); return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality); }