@@ -4170,14 +4170,17 @@ namespace ts {
41704170 else {
41714171 // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form)
41724172 const name = declaration.propertyName || <Identifier>declaration.name;
4173- if (isComputedNonLiteralName(name)) {
4174- // computed properties with non-literal names are treated as 'any'
4173+ const isLate = isLateBindableName(name);
4174+ const isWellKnown = isComputedPropertyName(name) && isWellKnownSymbolSyntactically(name.expression);
4175+ if (!isLate && !isWellKnown && isComputedNonLiteralName(name)) {
41754176 return anyType;
41764177 }
41774178
41784179 // Use type of the specified property, or otherwise, for a numeric name, the type of the numeric index signature,
41794180 // or otherwise the type of the string index signature.
4180- const text = getTextOfPropertyName(name);
4181+ const text = isLate ? getLateBoundNameFromType(checkComputedPropertyName(name as ComputedPropertyName) as LiteralType | UniqueESSymbolType) :
4182+ isWellKnown ? getPropertyNameForKnownSymbolName(idText(((name as ComputedPropertyName).expression as PropertyAccessExpression).name)) :
4183+ getTextOfPropertyName(name);
41814184
41824185 // Relax null check on ambient destructuring parameters, since the parameters have no implementation and are just documentation
41834186 if (strictNullChecks && declaration.flags & NodeFlags.Ambient && isParameterDeclaration(declaration)) {
@@ -4363,7 +4366,7 @@ namespace ts {
43634366 for (const declaration of symbol.declarations) {
43644367 let declarationInConstructor = false;
43654368 const expression = declaration.kind === SyntaxKind.BinaryExpression ? <BinaryExpression>declaration :
4366- declaration.kind === SyntaxKind.PropertyAccessExpression ? <BinaryExpression>getAncestor (declaration, SyntaxKind.BinaryExpression ) :
4369+ declaration.kind === SyntaxKind.PropertyAccessExpression ? cast (declaration.parent, isBinaryExpression ) :
43674370 undefined;
43684371
43694372 if (!expression) {
@@ -13875,7 +13878,8 @@ namespace ts {
1387513878 const assignmentKind = getAssignmentTargetKind(node);
1387613879
1387713880 if (assignmentKind) {
13878- if (!(localOrExportSymbol.flags & SymbolFlags.Variable)) {
13881+ if (!(localOrExportSymbol.flags & SymbolFlags.Variable) &&
13882+ !(isInJavaScriptFile(node) && localOrExportSymbol.flags & SymbolFlags.ValueModule)) {
1387913883 error(node, Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable, symbolToString(symbol));
1388013884 return unknownType;
1388113885 }
@@ -19086,6 +19090,9 @@ namespace ts {
1908619090
1908719091 const links = getNodeLinks(node);
1908819092 const type = getTypeOfSymbol(node.symbol);
19093+ if (isTypeAny(type)) {
19094+ return type;
19095+ }
1908919096
1909019097 // Check if function expression is contextually typed and assign parameter types if so.
1909119098 if (!(links.flags & NodeCheckFlags.ContextChecked)) {
@@ -19848,8 +19855,9 @@ namespace ts {
1984819855 // VarExpr = ValueExpr
1984919856 // requires VarExpr to be classified as a reference
1985019857 // A compound assignment furthermore requires VarExpr to be classified as a reference (section 4.1)
19851- // and the type of the non - compound operation to be assignable to the type of VarExpr.
19852- if (checkReferenceExpression(left, Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access)) {
19858+ // and the type of the non-compound operation to be assignable to the type of VarExpr.
19859+ if (checkReferenceExpression(left, Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access)
19860+ && (!isIdentifier(left) || unescapeLeadingUnderscores(left.escapedText) !== "exports")) {
1985319861 // to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported
1985419862 checkTypeAssignableTo(valueType, leftType, left, /*headMessage*/ undefined);
1985519863 }
@@ -21867,6 +21875,10 @@ namespace ts {
2186721875 // and give a better error message when the host function mentions `arguments`
2186821876 // but the tag doesn't have an array type
2186921877 if (decl) {
21878+ const i = getJSDocTags(decl).filter(isJSDocParameterTag).indexOf(node);
21879+ if (i > -1 && i < decl.parameters.length && isBindingPattern(decl.parameters[i].name)) {
21880+ return;
21881+ }
2187021882 if (!containsArgumentsReference(decl)) {
2187121883 error(node.name,
2187221884 Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name,
0 commit comments