Skip to content

JSDoc: function declarations are not type checked #16250

Closed
@OliverJAsh

Description

@OliverJAsh

TypeScript Version: 2.3.4

Code

{
  /** @type {function(number): number} */
  const foo = (x) => x
  foo('f') // error, good!

  /** @type {function(number): number} */
  function foo2(x) { return x }
  foo2('f') // expected error, but got none
}

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