We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc60e68 commit ecc9361Copy full SHA for ecc9361
1 file changed
src/compiler/checker.ts
@@ -7972,7 +7972,7 @@ namespace ts {
7972
return type;
7973
}
7974
const declaration = localOrExportSymbol.valueDeclaration;
7975
- const defaultsToDeclaredType = !strictNullChecks || !declaration ||
+ const defaultsToDeclaredType = !strictNullChecks || type.flags & TypeFlags.Any || !declaration ||
7976
declaration.kind === SyntaxKind.Parameter || isInAmbientContext(declaration) ||
7977
getContainingFunctionOrModule(declaration) !== getContainingFunctionOrModule(node);
7978
if (defaultsToDeclaredType && !(type.flags & TypeFlags.Narrowable)) {
0 commit comments