Skip to content

Commit

Permalink
Small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Apr 21, 2020
1 parent 33cbb82 commit ab993c2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7529,9 +7529,11 @@ namespace ts {
}

function isAutoTypedProperty(symbol: Symbol) {
// A property is auto-typed in noImplicitAny mode when its declaration has no type annotation or initializer.
// A property is auto-typed when its declaration has no type annotation or initializer and we're in
// noImplicitAny mode or a .js file.
const declaration = symbol.valueDeclaration;
return noImplicitAny && declaration && isPropertyDeclaration(declaration) && !declaration.type && !declaration.initializer;
return declaration && isPropertyDeclaration(declaration) && !getEffectiveTypeAnnotationNode(declaration) &&
!declaration.initializer && (noImplicitAny || isInJSFile(declaration));
}

function getDeclaringConstructor(symbol: Symbol) {
Expand Down

0 comments on commit ab993c2

Please sign in to comment.