Skip to content

Erroneous function type in @type takes effect in TypeScript code #16554

@ghost

Description

TypeScript Version: nightly (2.5.0-dev.20170615)

Code

(not legal JSDoc syntax, but that shouldn't matter in TypeScript code)

/**
 * @type {{foo: (function(string, string): string)}}
 */
const x = { foo: (a, b) => a + b };

Expected behavior:

No error.

Actual behavior:

src/a.ts(2,27): error TS2300: Duplicate identifier 'string'.
src/a.ts(2,35): error TS2300: Duplicate identifier 'string'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions