Skip to content

Unable to parse a tag's type expression #2151

@ydvelaitzky

Description

@ydvelaitzky

I added the following type in typescript:
`
/**

  • Represents an object with properties a and an optional function b.
  • @typedef {Object} Test
  • @Property {string} a
  • @Property {string | function} b
    */
    export type Test = {
    a: string
    b: string | ((y: any) => string),
    }

`

This is the error I am getting:

ERROR: Unable to parse a tag's type expression for source file ... with tag title "property" and text "{boolean | ((y: any) => boolean)} b": Invalid type expression "boolean | ((y: any) => boolean)": Expected "!", "$", "'", "*", ".", "...", "0", "?", "@", "Function", """, "\", "_", "break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "enum", "export", "extends", "false", "finally", "for", "function", "if", "implements", "import", "in", "instanceof", "interface", "let", "new", "null", "package", "private", "protected", "public", "return", "static", "super", "switch", "this", "throw", "true", "try", "typeof", "undefined", "var", "void", "while", "with", "yield", "{", Unicode letter number, Unicode lowercase letter, Unicode modifier letter, Unicode other letter, Unicode titlecase letter, Unicode uppercase letter, or [1-9] but "(" found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions