mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
not narrow static property without type annotation in constructor. (#39252)
* fix #39226 * fix lint.
This commit is contained in:
@@ -7825,7 +7825,7 @@ namespace ts {
|
||||
return addOptionality(type, isOptional);
|
||||
}
|
||||
|
||||
if (isPropertyDeclaration(declaration) && (noImplicitAny || isInJSFile(declaration))) {
|
||||
if (isPropertyDeclaration(declaration) && !hasStaticModifier(declaration) && (noImplicitAny || isInJSFile(declaration))) {
|
||||
// We have a property declaration with no type annotation or initializer, in noImplicitAny mode or a .js file.
|
||||
// Use control flow analysis of this.xxx assignments in the constructor to determine the type of the property.
|
||||
const constructor = findConstructorDeclaration(declaration.parent);
|
||||
|
||||
Reference in New Issue
Block a user