test/com/google/javascript/jscomp/parsing/ParserTest.java
/**
   * Tests that a JSDoc comment in an unexpected place of the code does not propagate to following
   * code due to {@link JSDocInfo} aggregation.
   */
Tests that a JSDoc comment in an unexpected place of the code does not propagate to following
code due to  JSDocInfo aggregation.
Tests that a JSDoc comment in an unexpected place of the code does not propagate to following code due to JSDocInfo aggregation .
@Test
  public void testJSDocAttachment6() {
    Node functionNode = parse(
        "var a = /** @param {number} index */5;"
        + "/** @return {boolean} */function f(index){}")
        .getSecondChild();
    assertNode(functionNode).hasType(Token.FUNCTION);
    JSDocInfo info = functionNode.getJSDocInfo();
    assertThat(info).isNotNull();
    assertThat(info.hasParameter("index")).isFalse();
    assertThat(info.hasReturnType()).isTrue();
    assertTypeEquals(BOOLEAN_TYPE, info.getReturnType());
  }
@ Test public void testJSDocAttachment6 ( ) { Node functionNode = parse ( "var a = /** @param {number} index */5;" + "/** @return {boolean} */function f(index){}" ) . getSecondChild ( ) ; assertNode ( functionNode ) . hasType ( Token . FUNCTION ) ; JSDocInfo info = functionNode . getJSDocInfo ( ) ; assertThat ( info ) . isNotNull ( ) ; assertThat ( info . hasParameter ( "index" ) ) . isFalse ( ) ; assertThat ( info . hasReturnType ( ) ) . isTrue ( ) ; assertTypeEquals ( BOOLEAN_TYPE , info . getReturnType ( ) ) ; }
Tests that a JSDoc comment in an unexpected place of the code does not propagate to following
 code due to {@link JSDocInfo} aggregation.
Tests that a JSDoc comment in an unexpected place of the code does not propagate to following code due to { @link JSDocInfo } aggregation .