@@ -438,8 +438,10 @@ namespace ts {
438
438
visitNode ( cbNode , ( < JSDocTypedefTag > node ) . typeExpression ) ;
439
439
}
440
440
case SyntaxKind . JSDocTypeLiteral :
441
- for ( const tag of ( node as JSDocTypeLiteral ) . jsDocPropertyTags ) {
442
- visitNode ( cbNode , tag ) ;
441
+ if ( ( node as JSDocTypeLiteral ) . jsDocPropertyTags ) {
442
+ for ( const tag of ( node as JSDocTypeLiteral ) . jsDocPropertyTags ) {
443
+ visitNode ( cbNode , tag ) ;
444
+ }
443
445
}
444
446
return ;
445
447
case SyntaxKind . PartiallyEmittedExpression :
@@ -6652,19 +6654,18 @@ namespace ts {
6652
6654
if ( ! typeExpression || isObjectOrObjectArrayTypeReference ( typeExpression . type ) ) {
6653
6655
let child : JSDocTypeTag | JSDocPropertyTag | false ;
6654
6656
let jsdocTypeLiteral : JSDocTypeLiteral ;
6655
- let alreadyHasTypeTag = false ;
6657
+ let childTypeTag : JSDocTypeTag ;
6656
6658
const start = scanner . getStartPos ( ) ;
6657
6659
while ( child = tryParse ( ( ) => parseChildParameterOrPropertyTag ( PropertyLikeParse . Property ) ) ) {
6658
6660
if ( ! jsdocTypeLiteral ) {
6659
6661
jsdocTypeLiteral = < JSDocTypeLiteral > createNode ( SyntaxKind . JSDocTypeLiteral , start ) ;
6660
6662
}
6661
6663
if ( child . kind === SyntaxKind . JSDocTypeTag ) {
6662
- if ( alreadyHasTypeTag ) {
6664
+ if ( childTypeTag ) {
6663
6665
break ;
6664
6666
}
6665
6667
else {
6666
- jsdocTypeLiteral . jsDocTypeTag = child ;
6667
- alreadyHasTypeTag = true ;
6668
+ childTypeTag = child ;
6668
6669
}
6669
6670
}
6670
6671
else {
@@ -6678,7 +6679,9 @@ namespace ts {
6678
6679
if ( typeExpression && typeExpression . type . kind === SyntaxKind . ArrayType ) {
6679
6680
jsdocTypeLiteral . isArrayType = true ;
6680
6681
}
6681
- typedefTag . typeExpression = finishNode ( jsdocTypeLiteral ) ;
6682
+ typedefTag . typeExpression = childTypeTag && ! isObjectOrObjectArrayTypeReference ( childTypeTag . typeExpression . type ) ?
6683
+ childTypeTag . typeExpression :
6684
+ finishNode ( jsdocTypeLiteral ) ;
6682
6685
}
6683
6686
}
6684
6687
0 commit comments