Starting from this code:
class ExampleAST {
/** @ctor */
constructor() {
/** @member */
this.member = 'value';
}
/* Trailing comment */
}
The /* Trailing comment */ is in the trailingComments of the ClassMethod "constructor". However, if you comment out the only line of code in the constructor:
class ExampleAST {
/** @ctor */
constructor() {
/** @member */
// this.member = 'value';
}
/* Trailing comment */
}
Then, the trailing comment appears in the trailing comments of the BlockStatement inside the constructor.
Furthermore, if you remove both comments from inside the constructor, then the trailing comments work as expected (trailing comments of the ClassMethod, not BlockStatement).
https://astexplorer.net/#/gist/3d8ffdbbe3c3f2929911f50419821e6e/1f6b623281bdc6a0b320aa1e115edcdca483dfe7