@@ -4493,8 +4493,8 @@ namespace ts {
4493
4493
if (declaration.kind === SyntaxKind.ExportAssignment) {
4494
4494
return links.type = checkExpression((<ExportAssignment>declaration).expression);
4495
4495
}
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);
4498
4498
}
4499
4499
// Handle variable, parameter or property
4500
4500
if (!pushTypeResolution(symbol, TypeSystemPropertyName.Type)) {
@@ -5074,20 +5074,9 @@ namespace ts {
5074
5074
return unknownType;
5075
5075
}
5076
5076
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);
5091
5080
5092
5081
if (popTypeResolution()) {
5093
5082
const typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol);
@@ -7662,9 +7651,12 @@ namespace ts {
7662
7651
links.resolvedType = emptyTypeLiteralType;
7663
7652
}
7664
7653
else {
7665
- const type = createObjectType(ObjectFlags.Anonymous, node.symbol);
7654
+ let type = createObjectType(ObjectFlags.Anonymous, node.symbol);
7666
7655
type.aliasSymbol = aliasSymbol;
7667
7656
type.aliasTypeArguments = getAliasTypeArgumentsForTypeNode(node);
7657
+ if (isJSDocTypeLiteral(node) && node.isArrayType) {
7658
+ type = createArrayType(type);
7659
+ }
7668
7660
links.resolvedType = type;
7669
7661
}
7670
7662
}
@@ -7898,7 +7890,8 @@ namespace ts {
7898
7890
case SyntaxKind.ParenthesizedType:
7899
7891
case SyntaxKind.JSDocNonNullableType:
7900
7892
case SyntaxKind.JSDocOptionalType:
7901
- return getTypeFromTypeNode((<ParenthesizedTypeNode | JSDocTypeReferencingNode>node).type);
7893
+ case SyntaxKind.JSDocTypeExpression:
7894
+ return getTypeFromTypeNode((<ParenthesizedTypeNode | JSDocTypeReferencingNode | JSDocTypeExpression>node).type);
7902
7895
case SyntaxKind.FunctionType:
7903
7896
case SyntaxKind.ConstructorType:
7904
7897
case SyntaxKind.TypeLiteral:
@@ -22646,8 +22639,7 @@ namespace ts {
22646
22639
}
22647
22640
22648
22641
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);
22651
22643
}
22652
22644
22653
22645
if (entityName.parent.kind === SyntaxKind.TypeParameter && entityName.parent.parent.kind === SyntaxKind.JSDocTemplateTag) {
0 commit comments