@@ -1272,8 +1272,10 @@ namespace ts {
1272
1272
case SyntaxKind.PropertyAccessExpression:
1273
1273
return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined;
1274
1274
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
1277
1279
default:
1278
1280
return undefined;
1279
1281
}
@@ -4917,6 +4919,8 @@ namespace ts {
4917
4919
*/
4918
4920
function getBaseConstructorTypeOfClass(type: InterfaceType): Type {
4919
4921
if (!type.resolvedBaseConstructorType) {
4922
+ const decl = <ClassLikeDeclaration>type.symbol.valueDeclaration;
4923
+ const extended = getClassExtendsHeritageClauseElement(decl);
4920
4924
const baseTypeNode = getBaseTypeNodeOfClass(type);
4921
4925
if (!baseTypeNode) {
4922
4926
return type.resolvedBaseConstructorType = undefinedType;
@@ -4925,6 +4929,10 @@ namespace ts {
4925
4929
return unknownType;
4926
4930
}
4927
4931
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
+ }
4928
4936
if (baseConstructorType.flags & (TypeFlags.Object | TypeFlags.Intersection)) {
4929
4937
// Resolving the members of a class requires us to resolve the base class of that class.
4930
4938
// We force resolution here such that we catch circularities now.
@@ -14866,6 +14874,7 @@ namespace ts {
14866
14874
14867
14875
function getSuggestionForNonexistentSymbol(location: Node, name: __String, meaning: SymbolFlags): string {
14868
14876
const result = resolveNameHelper(location, name, meaning, /*nameNotFoundMessage*/ undefined, name, /*isUse*/ false, (symbols, name, meaning) => {
14877
+ // `name` from the callback === the outer `name`
14869
14878
const symbol = getSymbol(symbols, name, meaning);
14870
14879
// 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
14871
14880
// So the table *contains* `x` but `x` isn't actually in scope.
@@ -19792,7 +19801,7 @@ namespace ts {
19792
19801
if (!getParameterSymbolFromJSDoc(node)) {
19793
19802
error(node.name,
19794
19803
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));
19796
19805
}
19797
19806
}
19798
19807
@@ -19808,9 +19817,7 @@ namespace ts {
19808
19817
if (extend) {
19809
19818
const className = getIdentifierFromEntityNameExpression(extend.expression);
19810
19819
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));
19814
19821
}
19815
19822
}
19816
19823
}
0 commit comments