@@ -113,13 +113,10 @@ export class DtsRollupGenerator {
113113 // Emit all the declarations for this entry
114114 for ( const astDeclaration of entity . astEntity . astDeclarations || [ ] ) {
115115 const declarationMetadata : DeclarationMetadata = collector . fetchMetadata ( astDeclaration ) ;
116- const checkDeclarationReleaseTag : boolean = (
117- astDeclaration . declaration . kind === ts . SyntaxKind . FunctionDeclaration ||
118- astDeclaration . declaration . kind === ts . SyntaxKind . MethodDeclaration
119- ) && ! ! declarationMetadata ;
120116
121117 if (
122- checkDeclarationReleaseTag &&
118+ astDeclaration . declaration . kind === ts . SyntaxKind . FunctionDeclaration &&
119+ ! ! declarationMetadata &&
123120 ! this . _shouldIncludeReleaseTag ( declarationMetadata . declaredReleaseTag , dtsKind )
124121 ) {
125122 if ( ! collector . extractorConfig . omitTrimmingComments ) {
@@ -279,8 +276,17 @@ export class DtsRollupGenerator {
279276 let trimmed : boolean = false ;
280277 if ( AstDeclaration . isSupportedSyntaxKind ( child . kind ) ) {
281278 childAstDeclaration = collector . astSymbolTable . getChildAstDeclarationByNode ( child . node , astDeclaration ) ;
279+ const childDeclarationMetadata : DeclarationMetadata = collector . fetchMetadata ( childAstDeclaration ) ;
280+ const symbolMetadata : SymbolMetadata = collector . fetchMetadata ( childAstDeclaration . astSymbol ) ;
281+ // If we have lower-release method overloads, include that information
282+ const useDeclarationReleaseTag : boolean = (
283+ childAstDeclaration . declaration . kind === ts . SyntaxKind . MethodDeclaration &&
284+ ! ! childDeclarationMetadata
285+ ) ;
286+ const releaseTag : ReleaseTag = useDeclarationReleaseTag
287+ ? childDeclarationMetadata . declaredReleaseTag
288+ : symbolMetadata . releaseTag ;
282289
283- const releaseTag : ReleaseTag = collector . fetchMetadata ( childAstDeclaration . astSymbol ) . releaseTag ;
284290 if ( ! this . _shouldIncludeReleaseTag ( releaseTag , dtsKind ) ) {
285291 let nodeToTrim : Span = child ;
286292
@@ -301,7 +307,9 @@ export class DtsRollupGenerator {
301307 modification . omitChildren = true ;
302308
303309 if ( ! collector . extractorConfig . omitTrimmingComments ) {
304- modification . prefix = `/* Excluded from this release type: ${ name } */` ;
310+ modification . prefix = useDeclarationReleaseTag
311+ ? `/* Excluded from this release type: ${ name } overload */`
312+ : `/* Excluded from this release type: ${ name } */` ;
305313 } else {
306314 modification . prefix = '' ;
307315 }
0 commit comments