@@ -7597,7 +7597,7 @@ namespace ts {
75977597
75987598 if (isPropertyDeclaration(declaration) && (noImplicitAny || isInJSFile(declaration))) {
75997599 // We have a property declaration with no type annotation or initializer, in noImplicitAny mode or a .js file.
7600- // Use control flow analysis of this.xxx assignments the constructor to determine the type of the property.
7600+ // Use control flow analysis of this.xxx assignments in the constructor to determine the type of the property.
76017601 const constructor = findConstructorDeclaration(declaration.parent);
76027602 const type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) :
76037603 getEffectiveModifierFlags(declaration) & ModifierFlags.Ambient ? getTypeOfPropertyInBaseClass(declaration.symbol) :
@@ -7622,7 +7622,7 @@ namespace ts {
76227622 }
76237623
76247624 function isConstructorDeclaredProperty(symbol: Symbol) {
7625- // A propery is considered a constructor declared property when all declaration sites are this.xxx assignments,
7625+ // A property is considered a constructor declared property when all declaration sites are this.xxx assignments,
76267626 // when no declaration sites have JSDoc type annotations, and when at least one declaration site is in the body of
76277627 // a class constructor.
76287628 if (symbol.valueDeclaration && isBinaryExpression(symbol.valueDeclaration)) {
@@ -10565,7 +10565,7 @@ namespace ts {
1056510565 // Since getApparentType may return a non-reduced union or intersection type, we need to perform
1056610566 // type reduction both before and after obtaining the apparent type. For example, given a type parameter
1056710567 // 'T extends A | B', the type 'T & X' becomes 'A & X | B & X' after obtaining the apparent type, and
10568- // that type may need futher reduction to remove empty intersections.
10568+ // that type may need further reduction to remove empty intersections.
1056910569 return getReducedType(getApparentType(getReducedType(type)));
1057010570 }
1057110571
@@ -23595,7 +23595,7 @@ namespace ts {
2359523595 for (const right of getPropertiesOfType(type)) {
2359623596 const left = props.get(right.escapedName);
2359723597 const rightType = getTypeOfSymbol(right);
23598- if (left && !maybeTypeOfKind(rightType, TypeFlags.Nullable) && !(maybeTypeOfKind(rightType, TypeFlags.Any ) && right.flags & SymbolFlags.Optional)) {
23598+ if (left && !maybeTypeOfKind(rightType, TypeFlags.Nullable) && !(maybeTypeOfKind(rightType, TypeFlags.AnyOrUnknown ) && right.flags & SymbolFlags.Optional)) {
2359923599 const diagnostic = error(left.valueDeclaration, Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, unescapeLeadingUnderscores(left.escapedName));
2360023600 addRelatedInfo(diagnostic, createDiagnosticForNode(spread, Diagnostics.This_spread_always_overwrites_this_property));
2360123601 }
0 commit comments