From 9a620bf616e1f6fac6d035ce43ad690455fa84a6 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 1 Jun 2016 11:39:22 -0700 Subject: [PATCH] Actually merge from master --- src/compiler/checker.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 52e70941408..ef11dc904ea 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8156,23 +8156,12 @@ namespace ts { return type; } const declaration = localOrExportSymbol.valueDeclaration; -<<<<<<< HEAD - const defaultsToDeclaredType = !strictNullChecks || type.flags & TypeFlags.Any || !declaration || - declaration.kind === SyntaxKind.Parameter || isInAmbientContext(declaration) || - getContainingFunctionOrModule(declaration) !== getContainingFunctionOrModule(node); - if (defaultsToDeclaredType && type.flags & TypeFlags.NotNarrowable) { - return type; - } - const flowType = getFlowTypeOfReference(node, type, defaultsToDeclaredType ? type : undefinedType); - if (strictNullChecks && !(type.flags & TypeFlags.Any) && !(getNullableKind(type) & TypeFlags.Undefined) && getNullableKind(flowType) & TypeFlags.Undefined) { -======= const includeOuterFunctions = isReadonlySymbol(localOrExportSymbol); const assumeInitialized = !strictNullChecks || (type.flags & TypeFlags.Any) !== 0 || !declaration || getRootDeclaration(declaration).kind === SyntaxKind.Parameter || isInAmbientContext(declaration) || !isDeclarationIncludedInFlow(node, declaration, includeOuterFunctions); const flowType = getFlowTypeOfReference(node, type, assumeInitialized, includeOuterFunctions); if (!assumeInitialized && !(getNullableKind(type) & TypeFlags.Undefined) && getNullableKind(flowType) & TypeFlags.Undefined) { ->>>>>>> master error(node, Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol)); // Return the declared type to reduce follow-on errors return type;