@@ -1272,8 +1272,10 @@ namespace ts {
12721272 case SyntaxKind.PropertyAccessExpression:
12731273 return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined;
12741274 case SyntaxKind.ExpressionWithTypeArguments:
1275- Debug.assert(isEntityNameExpression((<ExpressionWithTypeArguments>node).expression));
1276- return <EntityNameExpression>(<ExpressionWithTypeArguments>node).expression;
1275+ if (isEntityNameExpression((<ExpressionWithTypeArguments>node).expression)) {
1276+ return <EntityNameExpression>(<ExpressionWithTypeArguments>node).expression;
1277+ }
1278+ // falls through
12771279 default:
12781280 return undefined;
12791281 }
@@ -4917,6 +4919,8 @@ namespace ts {
49174919 */
49184920 function getBaseConstructorTypeOfClass(type: InterfaceType): Type {
49194921 if (!type.resolvedBaseConstructorType) {
4922+ const decl = <ClassLikeDeclaration>type.symbol.valueDeclaration;
4923+ const extended = getClassExtendsHeritageClauseElement(decl);
49204924 const baseTypeNode = getBaseTypeNodeOfClass(type);
49214925 if (!baseTypeNode) {
49224926 return type.resolvedBaseConstructorType = undefinedType;
@@ -4925,6 +4929,10 @@ namespace ts {
49254929 return unknownType;
49264930 }
49274931 const baseConstructorType = checkExpression(baseTypeNode.expression);
4932+ if (extended && baseTypeNode !== extended) {
4933+ Debug.assert(!extended.typeArguments); // Because this is in a JS file, and baseTypeNode is in an @extends tag
4934+ checkExpression(extended.expression);
4935+ }
49284936 if (baseConstructorType.flags & (TypeFlags.Object | TypeFlags.Intersection)) {
49294937 // Resolving the members of a class requires us to resolve the base class of that class.
49304938 // We force resolution here such that we catch circularities now.
@@ -14866,6 +14874,7 @@ namespace ts {
1486614874
1486714875 function getSuggestionForNonexistentSymbol(location: Node, name: __String, meaning: SymbolFlags): string {
1486814876 const result = resolveNameHelper(location, name, meaning, /*nameNotFoundMessage*/ undefined, name, /*isUse*/ false, (symbols, name, meaning) => {
14877+ // `name` from the callback === the outer `name`
1486914878 const symbol = getSymbol(symbols, name, meaning);
1487014879 // Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function
1487114880 // So the table *contains* `x` but `x` isn't actually in scope.
@@ -19792,7 +19801,7 @@ namespace ts {
1979219801 if (!getParameterSymbolFromJSDoc(node)) {
1979319802 error(node.name,
1979419803 Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name,
19795- unescapeLeadingUnderscores(( node.name.kind === SyntaxKind.QualifiedName ? node.name.right : node.name).escapedText ));
19804+ idText( node.name.kind === SyntaxKind.QualifiedName ? node.name.right : node.name));
1979619805 }
1979719806 }
1979819807
@@ -19808,9 +19817,7 @@ namespace ts {
1980819817 if (extend) {
1980919818 const className = getIdentifierFromEntityNameExpression(extend.expression);
1981019819 if (className && name.escapedText !== className.escapedText) {
19811- error(name, Diagnostics.JSDoc_augments_0_does_not_match_the_extends_1_clause,
19812- unescapeLeadingUnderscores(name.escapedText),
19813- unescapeLeadingUnderscores(className.escapedText));
19820+ error(name, Diagnostics.JSDoc_augments_0_does_not_match_the_extends_1_clause, idText(name), idText(className));
1981419821 }
1981519822 }
1981619823 }
0 commit comments