Skip to content

Commit d08960f

Browse files
committed
Allow exporting of consts even if strictNullChecks is on
1 parent a1a2006 commit d08960f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11807,7 +11807,7 @@ namespace ts {
1180711807
// the entire control flow graph from the variable's declaration (i.e. when the flow container and
1180811808
// declaration container are the same).
1180911809
const assumeInitialized = isParameter || isOuterVariable ||
11810-
type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & TypeFlags.Any) !== 0 || isInTypeQuery(node)) ||
11810+
type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & TypeFlags.Any) !== 0 || isInTypeQuery(node) || node.parent.kind === SyntaxKind.ExportSpecifier) ||
1181111811
isInAmbientContext(declaration);
1181211812
const initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, getRootDeclaration(declaration) as VariableLikeDeclaration) : type) :
1181311813
type === autoType || type === autoArrayType ? undefinedType :

0 commit comments

Comments
 (0)