From d08960fbd3400d0581dde5c1cd92c972bc638bc2 Mon Sep 17 00:00:00 2001 From: gcnew Date: Sun, 23 Apr 2017 19:12:56 +0300 Subject: [PATCH] Allow exporting of consts even if `strictNullChecks` is on --- 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 cb28cb0bd5c..d43bd907c46 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11807,7 +11807,7 @@ namespace ts { // the entire control flow graph from the variable's declaration (i.e. when the flow container and // declaration container are the same). const assumeInitialized = isParameter || isOuterVariable || - type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & TypeFlags.Any) !== 0 || isInTypeQuery(node)) || + type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & TypeFlags.Any) !== 0 || isInTypeQuery(node) || node.parent.kind === SyntaxKind.ExportSpecifier) || isInAmbientContext(declaration); const initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, getRootDeclaration(declaration) as VariableLikeDeclaration) : type) : type === autoType || type === autoArrayType ? undefinedType :