@@ -373,7 +373,7 @@ describe("Issue Tests", () => {
373373
374374 equal (
375375 Comment . combineDisplayParts (
376- query ( project , "Foo.baz" ) . signatures ?. [ 0 ] ?. comment ?. summary ,
376+ query ( project , "Foo.baz" ) . comment ?. summary ,
377377 ) ,
378378 "Some property style doc." ,
379379 "Property methods declared in interface should still allow comment inheritance" ,
@@ -944,12 +944,7 @@ describe("Issue Tests", () => {
944944 const project = convert ( ) ;
945945 const hook = query ( project , "Camera.useCameraPermissions" ) ;
946946 equal ( hook . type ?. type , "reflection" as const ) ;
947- equal (
948- Comment . combineDisplayParts (
949- hook . type . declaration . signatures ! [ 0 ] . comment ?. summary ,
950- ) ,
951- "One" ,
952- ) ;
947+ equal ( Comment . combineDisplayParts ( hook . comment ?. summary ) , "One" ) ;
953948 } ) ;
954949
955950 it ( "#2150" , ( ) => {
@@ -1420,4 +1415,19 @@ describe("Issue Tests", () => {
14201415 equal ( refl . type . toString ( ) , "Color" ) ;
14211416 equal ( refl . type . reflection ?. id , query ( project , "Color" ) . id ) ;
14221417 } ) ;
1418+
1419+ it ( "Does not duplicate comments due to signatures being present, #2509" , ( ) => {
1420+ const project = convert ( ) ;
1421+ const cb = query ( project , "Int.cb" ) ;
1422+ equal ( Comment . combineDisplayParts ( cb . comment ?. summary ) , "Cb" ) ;
1423+ equal ( cb . type ?. type , "reflection" ) ;
1424+ equal ( cb . type . declaration . signatures ! [ 0 ] . comment , undefined ) ;
1425+
1426+ const nested = query ( project , "Int.nested" ) ;
1427+ equal ( nested . type ?. type , "reflection" ) ;
1428+ const cb2 = nested . type . declaration . children ! [ 0 ] ;
1429+ equal ( Comment . combineDisplayParts ( cb2 . comment ?. summary ) , "Cb2" ) ;
1430+ equal ( cb2 . type ?. type , "reflection" ) ;
1431+ equal ( cb2 . type . declaration . signatures ! [ 0 ] . comment , undefined ) ;
1432+ } ) ;
14231433} ) ;
0 commit comments