@@ -4493,8 +4493,8 @@ namespace ts {
44934493 if (declaration.kind === SyntaxKind.ExportAssignment) {
44944494 return links.type = checkExpression((<ExportAssignment>declaration).expression);
44954495 }
4496- if (isInJavaScriptFile(declaration) && declaration.kind === SyntaxKind.JSDocPropertyTag && (<JSDocPropertyTag> declaration) .typeExpression) {
4497- return links.type = getTypeFromTypeNode((<JSDocPropertyTag> declaration) .typeExpression.type);
4496+ if (isInJavaScriptFile(declaration) && isJSDocPropertyLikeTag( declaration) && declaration.typeExpression) {
4497+ return links.type = getTypeFromTypeNode(declaration.typeExpression.type);
44984498 }
44994499 // Handle variable, parameter or property
45004500 if (!pushTypeResolution(symbol, TypeSystemPropertyName.Type)) {
@@ -5074,20 +5074,9 @@ namespace ts {
50745074 return unknownType;
50755075 }
50765076
5077- let declaration: JSDocTypedefTag | TypeAliasDeclaration = getDeclarationOfKind<JSDocTypedefTag>(symbol, SyntaxKind.JSDocTypedefTag);
5078- let type: Type;
5079- if (declaration) {
5080- if (declaration.jsDocTypeLiteral) {
5081- type = getTypeFromTypeNode(declaration.jsDocTypeLiteral);
5082- }
5083- else {
5084- type = getTypeFromTypeNode(declaration.typeExpression.type);
5085- }
5086- }
5087- else {
5088- declaration = getDeclarationOfKind<TypeAliasDeclaration>(symbol, SyntaxKind.TypeAliasDeclaration);
5089- type = getTypeFromTypeNode(declaration.type);
5090- }
5077+ const declaration = <JSDocTypedefTag | TypeAliasDeclaration>findDeclaration(
5078+ symbol, d => d.kind === SyntaxKind.JSDocTypedefTag || d.kind === SyntaxKind.TypeAliasDeclaration);
5079+ let type = getTypeFromTypeNode(declaration.kind === SyntaxKind.JSDocTypedefTag ? declaration.typeExpression : declaration.type);
50915080
50925081 if (popTypeResolution()) {
50935082 const typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol);
@@ -7662,9 +7651,12 @@ namespace ts {
76627651 links.resolvedType = emptyTypeLiteralType;
76637652 }
76647653 else {
7665- const type = createObjectType(ObjectFlags.Anonymous, node.symbol);
7654+ let type = createObjectType(ObjectFlags.Anonymous, node.symbol);
76667655 type.aliasSymbol = aliasSymbol;
76677656 type.aliasTypeArguments = getAliasTypeArgumentsForTypeNode(node);
7657+ if (isJSDocTypeLiteral(node) && node.isArrayType) {
7658+ type = createArrayType(type);
7659+ }
76687660 links.resolvedType = type;
76697661 }
76707662 }
@@ -7898,7 +7890,8 @@ namespace ts {
78987890 case SyntaxKind.ParenthesizedType:
78997891 case SyntaxKind.JSDocNonNullableType:
79007892 case SyntaxKind.JSDocOptionalType:
7901- return getTypeFromTypeNode((<ParenthesizedTypeNode | JSDocTypeReferencingNode>node).type);
7893+ case SyntaxKind.JSDocTypeExpression:
7894+ return getTypeFromTypeNode((<ParenthesizedTypeNode | JSDocTypeReferencingNode | JSDocTypeExpression>node).type);
79027895 case SyntaxKind.FunctionType:
79037896 case SyntaxKind.ConstructorType:
79047897 case SyntaxKind.TypeLiteral:
@@ -22646,8 +22639,7 @@ namespace ts {
2264622639 }
2264722640
2264822641 if (entityName.parent!.kind === SyntaxKind.JSDocParameterTag) {
22649- const parameter = getParameterFromJSDoc(entityName.parent as JSDocParameterTag);
22650- return parameter && parameter.symbol;
22642+ return getParameterSymbolFromJSDoc(entityName.parent as JSDocParameterTag);
2265122643 }
2265222644
2265322645 if (entityName.parent.kind === SyntaxKind.TypeParameter && entityName.parent.parent.kind === SyntaxKind.JSDocTemplateTag) {
0 commit comments