Skip to content

Closure Compiler type cast issues with multiline comments #6067

@arv

Description

@arv

When we have Google Closure Compiler unsafe static casts the parens gets removed when the @type is not directly after /** (whitespace and newlines allowed).

For example the following works as expected:

const style =/** 
  @type {{
    width: number,
  }}
*/({
  width,
});

Playground Link

But if we have multiline comments with leading * the parens gets stripped:

const style =/** 
 * @type {{
 *   width: number,
 * }}
*/({
  width,
});

and we end up with:

const style = /**
 * @type {{
 *   width: number,
 * }}
 */ {
    width,
};

Playground Link

Which leads to GCC compile errors.

CC @yangsu

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions